You are here

public function ScaffoldFileCollection::processScaffoldFiles in Drupal 9

Same name and namespace in other branches
  1. 8 composer/Plugin/Scaffold/Operations/ScaffoldFileCollection.php \Drupal\Composer\Plugin\Scaffold\Operations\ScaffoldFileCollection::processScaffoldFiles()

Processes the files in our collection.

Parameters

\Composer\IO\IOInterface $io: The Composer IO object.

\Drupal\Composer\Plugin\Scaffold\ScaffoldOptions $scaffold_options: The scaffold options.

Return value

\Drupal\Composer\Plugin\Scaffold\Operations\ScaffoldResult[] The results array.

File

composer/Plugin/Scaffold/Operations/ScaffoldFileCollection.php, line 133

Class

ScaffoldFileCollection
Collection of scaffold files.

Namespace

Drupal\Composer\Plugin\Scaffold\Operations

Code

public function processScaffoldFiles(IOInterface $io, ScaffoldOptions $scaffold_options) {
  $results = [];
  foreach ($this as $project_name => $scaffold_files) {
    $io
      ->write("Scaffolding files for <comment>{$project_name}</comment>:");
    foreach ($scaffold_files as $scaffold_file) {
      $results[$scaffold_file
        ->destination()
        ->relativePath()] = $scaffold_file
        ->process($io, $scaffold_options);
    }
  }
  return $results;
}