diff --git a/core/lib/Drupal/Component/Scaffold/Handler.php b/core/lib/Drupal/Component/Scaffold/Handler.php index e59c53c9ad..4ef96aa2d5 100644 --- a/core/lib/Drupal/Component/Scaffold/Handler.php +++ b/core/lib/Drupal/Component/Scaffold/Handler.php @@ -147,7 +147,7 @@ public function scaffold() { // Fail fast if the required 'web-root' location is not set in composer.json. $webRoot = $this->manageOptions->getOptions()->getLocation('web-root'); if (!$webRoot) { - throw new \RuntimeException("The extra.composer-scaffold.location.web-root is not set in the project's composer.json."); + throw new \RuntimeException("The extra.composer-scaffold.location.web-root configuration is not set in the project's composer.json."); } // Call any pre-scaffold scripts that may be defined. diff --git a/core/lib/Drupal/Component/Scaffold/Operations/OperationCollection.php b/core/lib/Drupal/Component/Scaffold/Operations/OperationCollection.php index ce2c00ddfd..8076f6a717 100644 --- a/core/lib/Drupal/Component/Scaffold/Operations/OperationCollection.php +++ b/core/lib/Drupal/Component/Scaffold/Operations/OperationCollection.php @@ -34,11 +34,10 @@ public function __construct(IOInterface $io) { /** * Finds the package name that provides the scaffold file. * - * Given the list of all scaffold file info objects, return the package that - * provides the scaffold file info for the scaffold file that will be placed - * at the destination that this scaffold file would be placed at. Note that - * this will be the same as $scaffold_file->packageName() unless this scaffold - * file has been overridden or removed by some other package. + * This will usually be $scaffold_file->packageName(), unless there are + * multiple scaffold files with the same destination path. In the case + * that there are multiple scaffold files, the name of the last package + * that provided a scaffold file at that path will be returned. * * @param \Drupal\Component\Scaffold\ScaffoldFileInfo[] $list_of_scaffold_files * Associative array containing destination => operation mappings. @@ -53,7 +52,7 @@ protected function findProvidingPackage(array $list_of_scaffold_files, ScaffoldF // just to be sure that it really is. $dest_rel_path = $scaffold_file->destination()->relativePath(); if (!array_key_exists($dest_rel_path, $list_of_scaffold_files)) { - throw new \RuntimeException("Scaffold file not found in list of all scaffold files."); + throw new \RuntimeException("Scaffold file $dest_rel_path not found in list of all scaffold files."); } return $list_of_scaffold_files[$dest_rel_path]->packageName(); } diff --git a/core/lib/Drupal/Component/Scaffold/Plugin.php b/core/lib/Drupal/Component/Scaffold/Plugin.php index bf91dbae3a..71d049eccf 100644 --- a/core/lib/Drupal/Component/Scaffold/Plugin.php +++ b/core/lib/Drupal/Component/Scaffold/Plugin.php @@ -30,9 +30,9 @@ class Plugin implements PluginInterface, EventSubscriberInterface, Capable { * {@inheritdoc} */ public function activate(Composer $composer, IOInterface $io) { - // We use a separate PluginScripts object. This way we separate - // functionality and also avoid some debug issues with the plugin being - // copied on initialisation. + // We use a Handler object to separate the main functionality + // of this plugin from the Composer API. This also avoids some + // debug issues with the plugin being copied on initialisation. // @see \Composer\Plugin\PluginManager::registerPackage() $this->handler = new Handler($composer, $io); } diff --git a/core/tests/Drupal/Tests/Component/Scaffold/Functional/ScaffoldTest.php b/core/tests/Drupal/Tests/Component/Scaffold/Functional/ScaffoldTest.php index a5b88a1eb0..e272dedc47 100644 --- a/core/tests/Drupal/Tests/Component/Scaffold/Functional/ScaffoldTest.php +++ b/core/tests/Drupal/Tests/Component/Scaffold/Functional/ScaffoldTest.php @@ -181,8 +181,8 @@ public function testProjectWithoutWebRoot() { $is_link = FALSE; $relocated_docroot = FALSE; - $this->expectException(\Exception::class); - $this->expectExceptionMessage("The extra.composer-scaffold.location.web-root is not set in the project's composer.json."); + $this->expectException(\RuntimeException::class); + $this->expectExceptionMessage("The extra.composer-scaffold.location.web-root configuration is not set in the project's composer.json."); list($docroot, $scaffoldOutput) = $this->scaffoldSut($fixture_name, $is_link, $relocated_docroot); }