diff --git a/core/lib/Drupal/Component/Scaffold/AllowedPackages.php b/core/lib/Drupal/Component/Scaffold/AllowedPackages.php
index 45e858e613..6d23ef2398 100644
--- a/core/lib/Drupal/Component/Scaffold/AllowedPackages.php
+++ b/core/lib/Drupal/Component/Scaffold/AllowedPackages.php
@@ -112,7 +112,7 @@ public function event(PackageEvent $event) {
   protected function recursiveGetAllowedPackages(array $packages_to_allow, array $allowed_packages = []) {
     foreach ($packages_to_allow as $name) {
       $package = $this->getPackage($name);
-      if ($package && $package instanceof PackageInterface && !array_key_exists($name, $allowed_packages)) {
+      if ($package instanceof PackageInterface && !isset($allowed_packages[$name])) {
         $allowed_packages[$name] = $package;
         $package_options = $this->manageOptions->packageOptions($package);
         $allowed_packages = $this->recursiveGetAllowedPackages($package_options->allowedPackages(), $allowed_packages);
@@ -136,14 +136,17 @@ protected function recursiveGetAllowedPackages(array $packages_to_allow, array $
   protected function evaluateNewPackages(array $allowed_packages) {
     foreach ($this->newPackages as $name => $newPackage) {
       if (!array_key_exists($name, $allowed_packages)) {
-        $this->io->write("Package <comment>{$name}</comment> has scaffold operations, but it is not allowed in the root-level composer.json file.");
+        $this->io->write("Package <comment>{$name}</comment> has scaffold operations. In order to function correctly, this project must be listed in the element 'extra.composer-scaffold.allowed-packages' in the root-level composer.json file.");
       }
       else {
         $this->io->write("Package <comment>{$name}</comment> has scaffold operations, and is already allowed in the root-level composer.json file.");
       }
     }
     // @todo We could prompt the user and ask if they wish to allow a
-    // newly-added package.
+    // newly-added package. This might be useful if, for example, the user
+    // might wish to require an installation profile that contains scaffolded
+    // assets. For more information, see:
+    // https://www.drupal.org/project/drupal/issues/3064990
     return $allowed_packages;
   }
 
diff --git a/core/lib/Drupal/Component/Scaffold/GenerateAutoloadReferenceFile.php b/core/lib/Drupal/Component/Scaffold/GenerateAutoloadReferenceFile.php
index d0d715f936..30d2ce1d36 100644
--- a/core/lib/Drupal/Component/Scaffold/GenerateAutoloadReferenceFile.php
+++ b/core/lib/Drupal/Component/Scaffold/GenerateAutoloadReferenceFile.php
@@ -56,6 +56,7 @@ public static function generateAutoload(IOInterface $io, $package_name, $web_roo
    *   The name of the package defining the autoload file (the root package).
    * @param string $web_root
    *   The path to the web root.
+   *
    * @return bool
    *   True if autoload.php file exists and has been committed to the repository
    */
@@ -63,7 +64,7 @@ public static function autoloadFileCommitted(IOInterface $io, $package_name, $we
     $autoload_path = static::autoloadPath($package_name, $web_root);
     $location = dirname($autoload_path->fullPath());
     if (!file_exists($location)) {
-      return false;
+      return FALSE;
     }
     return Git::checkTracked($io, $location, $location);
   }
diff --git a/core/lib/Drupal/Component/Scaffold/Operations/AppendOp.php b/core/lib/Drupal/Component/Scaffold/Operations/AppendOp.php
index a608180abc..97fbfcb76a 100644
--- a/core/lib/Drupal/Component/Scaffold/Operations/AppendOp.php
+++ b/core/lib/Drupal/Component/Scaffold/Operations/AppendOp.php
@@ -68,8 +68,8 @@ public function process(ScaffoldFilePath $destination, IOInterface $io, Scaffold
       $io->write($interpolator->interpolate("  - Append to <info>[dest-rel-path]</info> from <info>[append-rel-path]</info>"));
     }
     if (!empty(trim($prepend_contents)) || !empty(trim($append_contents))) {
-      // Assume that none of these files is very large, so load them all into
-      // memory for now. Considering uses streams to scaffold large files.
+      // None of our asset files are very large, so we will load each one into
+      // memory for processing.
       $original_contents = file_get_contents($destination_path);
       // Write the appended and prepended contents back to the file.
       $altered_contents = $prepend_contents . $original_contents . $append_contents;
diff --git a/core/lib/Drupal/Component/Scaffold/Operations/OperationFactory.php b/core/lib/Drupal/Component/Scaffold/Operations/OperationFactory.php
index 7884390908..b517eda081 100644
--- a/core/lib/Drupal/Component/Scaffold/Operations/OperationFactory.php
+++ b/core/lib/Drupal/Component/Scaffold/Operations/OperationFactory.php
@@ -10,6 +10,7 @@
  * Create Scaffold operation objects based on provided metadata.
  */
 class OperationFactory {
+
   /**
    * The Composer service.
    *
@@ -49,7 +50,7 @@ public function create(PackageInterface $package, OperationData $operation_data)
       case SkipOp::ID:
         return new SkipOp();
 
-      case 'replace':
+      case ReplaceOp::ID:
         return $this->createReplaceOp($package, $operation_data);
 
       case AppendOp::ID:
diff --git a/core/lib/Drupal/Component/Scaffold/Operations/ReplaceOp.php b/core/lib/Drupal/Component/Scaffold/Operations/ReplaceOp.php
index 7250a49b2e..450c448bb6 100644
--- a/core/lib/Drupal/Component/Scaffold/Operations/ReplaceOp.php
+++ b/core/lib/Drupal/Component/Scaffold/Operations/ReplaceOp.php
@@ -46,8 +46,6 @@ public function __construct(ScaffoldFilePath $sourcePath, $overwrite = TRUE) {
   }
 
   /**
-   * Copy or Symlink the specified scaffold file.
-   *
    * {@inheritdoc}
    */
   public function process(ScaffoldFilePath $destination, IOInterface $io, ScaffoldOptions $options) {
diff --git a/core/lib/Drupal/Component/Scaffold/Operations/ScaffoldFileCollator.php b/core/lib/Drupal/Component/Scaffold/Operations/ScaffoldFileCollator.php
index 6c77b9c68d..57a2fbc44a 100644
--- a/core/lib/Drupal/Component/Scaffold/Operations/ScaffoldFileCollator.php
+++ b/core/lib/Drupal/Component/Scaffold/Operations/ScaffoldFileCollator.php
@@ -20,17 +20,20 @@ class ScaffoldFileCollator {
   protected $io;
 
   /**
-   * Collation of all scaffold files. The top level array maps from the
-   * package name to the collection of scaffold files provided by that
-   * package. Each collection of scaffold files is keyed by destination path.
+   * Collation of all scaffold files.
+   *
+   * The top level array maps from the 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[][]
    */
   protected $resolvedFileMappings = [];
 
   /**
-   * Collection of all destination paths to be scaffolded to the last file
-   * to scaffold at each location.
+   * Collection of all destination paths to be scaffolded.
+   *
+   * Each key maps to the last file to scaffold at each location.
    *
    * @var \Drupal\Component\Scaffold\ScaffoldFileInfo[]
    */
@@ -77,10 +80,28 @@ public function collateScaffoldFiles(array $file_mappings, Interpolator $locatio
     }
   }
 
+  /**
+   * Provides access to the resolved scaffold files.
+   *
+   * @return \Drupal\Component\Scaffold\ScaffoldFileInfo[][]
+   *   Collation of all scaffold files.
+   */
   public function resolvedScaffoldFiles() {
     return $this->resolvedFileMappings;
   }
 
+  /**
+   * Determines whether a given location has been overridden.
+   *
+   * As a side effect, reports a status message noting that the file was
+   * skipped.
+   *
+   * @param ScaffoldFileInfo $scaffold_file
+   *   Scaffold file location to test overridden status.
+   *
+   * @return bool
+   *   TRUE if specified location is overridden by another package.
+   */
   public function overridden(ScaffoldFileInfo $scaffold_file) {
     $overriding_package = $this->findProvidingPackage($scaffold_file);
     $overridden = $scaffold_file->overridden($overriding_package);
diff --git a/core/lib/Drupal/Component/Scaffold/Plugin.php b/core/lib/Drupal/Component/Scaffold/Plugin.php
index 3762cfad06..9a4c045a19 100644
--- a/core/lib/Drupal/Component/Scaffold/Plugin.php
+++ b/core/lib/Drupal/Component/Scaffold/Plugin.php
@@ -20,6 +20,7 @@
  * Composer plugin for handling drupal scaffold.
  */
 class Plugin implements PluginInterface, EventSubscriberInterface, Capable {
+
   /**
    * The Composer Scaffold handler.
    *
diff --git a/core/tests/Drupal/Tests/Component/Scaffold/fixtures/scripts/disable-git-bin/git b/core/tests/Drupal/Tests/Component/Scaffold/fixtures/scripts/disable-git-bin/git
old mode 100644
new mode 100755
