You are here

class ModifiedFiles in Automatic Updates 7

Modified code checker.

Hierarchy

Expanded class hierarchy of ModifiedFiles

1 string reference to 'ModifiedFiles'
ReadinessCheckerManager::getCheckers in ReadinessCheckers/ReadinessCheckerManager.php
Get checkers.

File

ReadinessCheckers/ModifiedFiles.php, line 6

View source
class ModifiedFiles implements ReadinessCheckerInterface {
  use ProjectInfoTrait;

  /**
   * {@inheritdoc}
   */
  public static function run() {
    return static::modifiedFilesCheck();
  }

  /**
   * Check if the site contains any modified code.
   *
   * @return array
   *   An array of translatable strings if any checks fail.
   */
  protected static function modifiedFilesCheck() {
    $messages = [];
    $filtered_modified_files = new IgnoredPathsIteratorFilter(ModifiedFilesService::getModifiedFiles(static::getInfos()));
    foreach ($filtered_modified_files as $file) {
      $messages[] = 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;
  }

}

Members

Namesort descending Modifiers Type Description Overrides
ModifiedFiles::modifiedFilesCheck protected static function Check if the site contains any modified code.
ModifiedFiles::run public static function Run check. Overrides ReadinessCheckerInterface::run
ProjectInfoTrait::getExtensionVersion protected static function Get the extension version.
ProjectInfoTrait::getInfos protected static function Returns an array of info files information of available extensions.
ProjectInfoTrait::getProjectName protected static function Get the extension's project name.