Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. ScaffoldFileCollection.php

function ScaffoldFileCollection::checkUnchanged

Returns the list of files that have not changed since they were scaffolded.

Note that there are two reasons a file may have changed:

  • The user modified it after it was scaffolded.
  • The package the file came to was updated, and the file is different in the new version.

With the current scaffold code, we cannot tell the difference between the two.

Return value

string[] List of relative paths to unchanged files on disk.

See also

https://www.drupal.org/project/drupal/issues/3092563

File

composer/Plugin/Scaffold/Operations/ScaffoldFileCollection.php, line 186

Class

ScaffoldFileCollection
Collection of scaffold files.

Namespace

Drupal\Composer\Plugin\Scaffold\Operations

Code

public function checkUnchanged() {
    $results = [];
    foreach ($this as $scaffold_files) {
        foreach ($scaffold_files as $scaffold_file) {
            if (!$scaffold_file->hasChanged()) {
                $results[] = $scaffold_file->destination()
                    ->relativePath();
            }
        }
    }
    return $results;
}
RSS feed
Powered by Drupal