You are here

trait ReadinessTrait in Automatic Updates 8.2

Common methods for working with readiness checkers.

Hierarchy

File

src/Validation/ReadinessTrait.php, line 11

Namespace

Drupal\automatic_updates\Validation
View source
trait ReadinessTrait {

  /**
   * Gets a message, based on severity, when readiness checkers fail.
   *
   * @param int $severity
   *   The severity. Should be one of the SystemManager::REQUIREMENT_*
   *   constants.
   *
   * @return \Drupal\Core\StringTranslation\TranslatableMarkup
   *   The message.
   *
   * @see \Drupal\system\SystemManager::REQUIREMENT_ERROR
   * @see \Drupal\system\SystemManager::REQUIREMENT_WARNING
   */
  protected function getFailureMessageForSeverity(int $severity) : TranslatableMarkup {
    return $severity === SystemManager::REQUIREMENT_WARNING ? $this
      ->t('Your site does not pass some readiness checks for automatic updates. Depending on the nature of the failures, it might affect the eligibility for automatic updates.') : $this
      ->t('Your site does not pass some readiness checks for automatic updates. It cannot be automatically updated until further action is performed.');
  }

}

Members

Namesort descending Modifiers Type Description Overrides
ReadinessTrait::getFailureMessageForSeverity protected function Gets a message, based on severity, when readiness checkers fail.