/**
* Gets the array of file mappings provided by a given package.
*
* @param \Composer\Package\PackageInterface $package
* The Composer package from which to get the file mappings.
*
* @return \Drupal\Composer\Plugin\Scaffold\Operations\OperationInterface[]
* An array of destination paths => scaffold operation objects.
*/
protected function getPackageFileMappings(PackageInterface
$package) { $options =
$this->manageOptions->
packageOptions($package);
if ($options->
hasFileMapping()) { return $this->
createScaffoldOperations($package,
$options->
fileMapping());
} // Warn the user if they allow a package that does not have any scaffold
// files. We will ignore drupal/core, though, as it is implicitly allowed,
// but might not have scaffold files (version 8.7.x and earlier).
if (!
$options->
hasAllowedPackages() && ($package->
getName() != 'drupal/core'
)) { $this->io->
writeError("The allowed package {
$package->
getName()} does not provide a file mapping for Composer Scaffold."
);
} return [];
}