function ScaffoldFileCollection::process

Same name in other branches
  1. 9 composer/Plugin/Scaffold/Operations/ScaffoldFileCollection.php \Drupal\Composer\Plugin\Scaffold\Operations\ScaffoldFileCollection::process()
  2. 10 composer/Plugin/Scaffold/Operations/ScaffoldFileCollection.php \Drupal\Composer\Plugin\Scaffold\Operations\ScaffoldFileCollection::process()
  3. 11.x composer/Plugin/Scaffold/Operations/ScaffoldFileCollection.php \Drupal\Composer\Plugin\Scaffold\Operations\ScaffoldFileCollection::process()

Processes the iterator created by ScaffoldFileCollection::create().

@deprecated. Called when upgrading from the Core Composer Scaffold plugin version 8.8.x due to a bug in the plugin and handler classes. Do not use in 8.9.x or 9.x, and remove in Drupal 10.x.

Parameters

\Drupal\Composer\Plugin\Scaffold\Operations\ScaffoldFileCollection $collection: The iterator to process.

\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 161

Class

ScaffoldFileCollection
Collection of scaffold files.

Namespace

Drupal\Composer\Plugin\Scaffold\Operations

Code

public static function process(ScaffoldFileCollection $collection, IOInterface $io, ScaffoldOptions $scaffold_options) {
    $results = [];
    foreach ($collection 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;
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.