You are here

protected function Handler::createScaffoldOperations in Drupal 9

Same name and namespace in other branches
  1. 8 composer/Plugin/Scaffold/Handler.php \Drupal\Composer\Plugin\Scaffold\Handler::createScaffoldOperations()
  2. 10 composer/Plugin/Scaffold/Handler.php \Drupal\Composer\Plugin\Scaffold\Handler::createScaffoldOperations()

Creates scaffold operation objects for all items in the file mappings.

Parameters

\Composer\Package\PackageInterface $package: The package that relative paths will be relative from.

array $package_file_mappings: The package file mappings array keyed by destination path and the values are operation metadata arrays.

Return value

\Drupal\Composer\Plugin\Scaffold\Operations\OperationInterface[] A list of scaffolding operation objects

1 call to Handler::createScaffoldOperations()
Handler::getPackageFileMappings in composer/Plugin/Scaffold/Handler.php
Gets the array of file mappings provided by a given package.

File

composer/Plugin/Scaffold/Handler.php, line 122

Class

Handler
Core class of the plugin.

Namespace

Drupal\Composer\Plugin\Scaffold

Code

protected function createScaffoldOperations(PackageInterface $package, array $package_file_mappings) {
  $scaffold_op_factory = new OperationFactory($this->composer);
  $scaffold_ops = [];
  foreach ($package_file_mappings as $dest_rel_path => $data) {
    $operation_data = new OperationData($dest_rel_path, $data);
    $scaffold_ops[$dest_rel_path] = $scaffold_op_factory
      ->create($package, $operation_data);
  }
  return $scaffold_ops;
}