class ScaffoldFileCollection implements IteratorAggregate (View source)

internal  
 

Collection of scaffold files.

Properties

protected ScaffoldFileInfo[][] $scaffoldFilesByProject

Nested list of all scaffold files.

Methods

__construct(array $file_mappings, Interpolator $location_replacements)

ScaffoldFileCollection constructor.

filterFiles(array $files_to_filter)

Removes any item that has a path matching any path in the provided list.

bool
checkListHasItemWithContent(array $scaffold_files)

Scans through a list of scaffold files and determines if any has contents.

getIterator()

{@inheritdoc}

processScaffoldFiles(IOInterface $io, ScaffoldOptions $scaffold_options)

Processes the files in our collection.

static 
process(ScaffoldFileCollection $collection, IOInterface $io, ScaffoldOptions $scaffold_options)

No description

string[]
checkUnchanged()

Returns the list of files that have not changed since they were scaffolded.

Details

__construct(array $file_mappings, Interpolator $location_replacements)

ScaffoldFileCollection constructor.

Parameters

array $file_mappings

A multidimensional array of file mappings.

Interpolator $location_replacements

An object with the location mappings (e.g. [web-root]).

filterFiles(array $files_to_filter)

Removes any item that has a path matching any path in the provided list.

Matching is done via destination path.

Parameters

array $files_to_filter

List of destination paths

protected bool checkListHasItemWithContent(array $scaffold_files)

Scans through a list of scaffold files and determines if any has contents.

Parameters

array $scaffold_files

List of scaffold files, path: ScaffoldFileInfo

Return Value

bool

TRUE if at least one item in the list has content

getIterator()

{@inheritdoc}

ScaffoldResult[] processScaffoldFiles(IOInterface $io, ScaffoldOptions $scaffold_options)

Processes the files in our collection.

Parameters

IOInterface $io

The Composer IO object.

ScaffoldOptions $scaffold_options

The scaffold options.

Return Value

ScaffoldResult[]

The results array.

static process(ScaffoldFileCollection $collection, IOInterface $io, ScaffoldOptions $scaffold_options)

No description

Parameters

ScaffoldFileCollection $collection
IOInterface $io
ScaffoldOptions $scaffold_options

string[] checkUnchanged()

Returns the list of files that have not changed since they were scaffolded.

Note that there are two reasons a file may have changed:

  • The user modified it after it was scaffolded.
  • The package the file came to was updated, and the file is different in the new version.

With the current scaffold code, we cannot tell the difference between the two. https://www.drupal.org/project/drupal/issues/3092563

Return Value

string[]

List of relative paths to unchanged files on disk.