You are here

protected function ModifiedFiles::modifiedFilesCheck in Automatic Updates 8

Check if the site contains any modified code.

Return value

array An array of translatable strings if any checks fail.

1 call to ModifiedFiles::modifiedFilesCheck()
ModifiedFiles::run in src/ReadinessChecker/ModifiedFiles.php
Run check.

File

src/ReadinessChecker/ModifiedFiles.php, line 86

Class

ModifiedFiles
Modified code checker.

Namespace

Drupal\automatic_updates\ReadinessChecker

Code

protected function modifiedFilesCheck() {
  $messages = [];
  $extensions = [];
  foreach ($this
    ->getExtensionsTypes() as $extension_type) {
    $extensions[] = $this
      ->getInfos($extension_type);
  }
  $extensions = array_merge(...$extensions);
  $filtered_modified_files = new IgnoredPathsIteratorFilter($this->modifiedFiles
    ->getModifiedFiles($extensions));
  foreach ($filtered_modified_files as $file) {
    $messages[] = $this
      ->t('The hash for @file does not match its original. Updates that include that file will fail and require manual intervention.', [
      '@file' => $file,
    ]);
  }
  return $messages;
}