diff --git a/core/lib/Drupal/Component/Scaffold/GenerateAutoloadReferenceFile.php b/core/lib/Drupal/Component/Scaffold/GenerateAutoloadReferenceFile.php index 654a65e1ba..89cdb3c355 100644 --- a/core/lib/Drupal/Component/Scaffold/GenerateAutoloadReferenceFile.php +++ b/core/lib/Drupal/Component/Scaffold/GenerateAutoloadReferenceFile.php @@ -39,7 +39,7 @@ public static function generateAutoload(IOInterface $io, $package_name, $web_roo $location = dirname($autoload_path->fullPath()); // Exit early if the autoload file already exists and is committed. if (static::autoloadFileCommitted($io, $location)) { - return; + return new ScaffoldResult($autoload_path, TRUE); } // Calculate the relative path from the webroot (location of the project // autoload.php) to the vendor directory. @@ -58,7 +58,7 @@ public static function generateAutoload(IOInterface $io, $package_name, $web_roo */ protected static function autoloadFileCommitted(IOInterface $io, $location) { if (!file_exists($location)) { - return false; + return FALSE; } return Git::checkTracked($io, $location, $location); } diff --git a/core/lib/Drupal/Component/Scaffold/Interpolator.php b/core/lib/Drupal/Component/Scaffold/Interpolator.php index 7fe152bd90..c399959342 100644 --- a/core/lib/Drupal/Component/Scaffold/Interpolator.php +++ b/core/lib/Drupal/Component/Scaffold/Interpolator.php @@ -45,7 +45,7 @@ public function __construct($start_token = '\\[', $end_token = '\\]') { * Sets the data set to use when interpolating. * * @param array $data - * key:value pairs to use when interpolating. + * Key:value pairs to use when interpolating. * * @return $this */ @@ -58,7 +58,7 @@ public function setData(array $data) { * Adds to the data set to use when interpolating. * * @param array $data - * key:value pairs to use when interpolating.. + * Key:value pairs to use when interpolating.. * * @return $this */ diff --git a/core/lib/Drupal/Component/Scaffold/Operations/OperationCollection.php b/core/lib/Drupal/Component/Scaffold/Operations/OperationCollection.php index d57dd84962..ad0b734e64 100644 --- a/core/lib/Drupal/Component/Scaffold/Operations/OperationCollection.php +++ b/core/lib/Drupal/Component/Scaffold/Operations/OperationCollection.php @@ -4,8 +4,6 @@ use Composer\IO\IOInterface; use Drupal\Component\Scaffold\Interpolator; -use Drupal\Component\Scaffold\ScaffoldFileInfo; -use Drupal\Component\Scaffold\ScaffoldFilePath; use Drupal\Component\Scaffold\ScaffoldOptions; /** diff --git a/core/lib/Drupal/Component/Scaffold/Operations/OperationData.php b/core/lib/Drupal/Component/Scaffold/Operations/OperationData.php index 142c2b4ce8..c400faa61f 100644 --- a/core/lib/Drupal/Component/Scaffold/Operations/OperationData.php +++ b/core/lib/Drupal/Component/Scaffold/Operations/OperationData.php @@ -2,8 +2,6 @@ namespace Drupal\Component\Scaffold\Operations; -use Drupal\Component\Scaffold\ScaffoldFilePath; - /** * Holds parameter data for operation objects during operation creation only. */ diff --git a/core/lib/Drupal/Component/Scaffold/Operations/ScaffoldFileCollator.php b/core/lib/Drupal/Component/Scaffold/Operations/ScaffoldFileCollator.php index b3061adec7..6c77b9c68d 100644 --- a/core/lib/Drupal/Component/Scaffold/Operations/ScaffoldFileCollator.php +++ b/core/lib/Drupal/Component/Scaffold/Operations/ScaffoldFileCollator.php @@ -6,7 +6,6 @@ use Drupal\Component\Scaffold\Interpolator; use Drupal\Component\Scaffold\ScaffoldFileInfo; use Drupal\Component\Scaffold\ScaffoldFilePath; -use Drupal\Component\Scaffold\ScaffoldOptions; /** * Collates the scaffold file for the OperationCollection class. @@ -25,7 +24,7 @@ class ScaffoldFileCollator { * package name to the collection of scaffold files provided by that * package. Each collection of scaffold files is keyed by destination path. * - * @var \Drupal\Component\Scaffold\ScaffoldFileInfo[][] $resolvedFileMappings + * @var \Drupal\Component\Scaffold\ScaffoldFileInfo[][] */ protected $resolvedFileMappings = []; @@ -33,7 +32,7 @@ class ScaffoldFileCollator { * Collection of all destination paths to be scaffolded to the last file * to scaffold at each location. * - * @var \Drupal\Component\Scaffold\ScaffoldFileInfo[] $listOfScaffoldFiles + * @var \Drupal\Component\Scaffold\ScaffoldFileInfo[] */ protected $listOfScaffoldFiles = []; @@ -99,8 +98,6 @@ public function overridden(ScaffoldFileInfo $scaffold_file) { * 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[] $listOfScaffoldFiles - * Associative array containing destination => operation mappings. * @param \Drupal\Component\Scaffold\ScaffoldFileInfo $scaffold_file * The scaffold file to use to find a providing package name. * diff --git a/core/lib/Drupal/Component/Scaffold/Plugin.php b/core/lib/Drupal/Component/Scaffold/Plugin.php index d6f76577ae..8131189b38 100644 --- a/core/lib/Drupal/Component/Scaffold/Plugin.php +++ b/core/lib/Drupal/Component/Scaffold/Plugin.php @@ -41,7 +41,7 @@ public function activate(Composer $composer, IOInterface $io) { * {@inheritdoc} */ public function getCapabilities() { - return [\Composer\Plugin\Capability\CommandProvider::class => ScaffoldCommandProvider::class]; + return [CommandProvider::class => ScaffoldCommandProvider::class]; } /** diff --git a/core/tests/Drupal/Tests/Component/Scaffold/Integration/ScaffoldFileCollatorTest.php b/core/tests/Drupal/Tests/Component/Scaffold/Integration/ScaffoldFileCollatorTest.php index b0fa4b9a7b..b51f94fc75 100644 --- a/core/tests/Drupal/Tests/Component/Scaffold/Integration/ScaffoldFileCollatorTest.php +++ b/core/tests/Drupal/Tests/Component/Scaffold/Integration/ScaffoldFileCollatorTest.php @@ -124,7 +124,7 @@ protected function assertOverridden($project, $dest, array $scaffold_list, array protected function accessProtected($obj, $prop) { $reflection = new \ReflectionClass($obj); $property = $reflection->getProperty($prop); - $property->setAccessible(true); + $property->setAccessible(TRUE); return $property->getValue($obj); }