You are here

protected function DiagnosticCheckBase::runCheck in Purge 8.3

Late runtime helper to assure that ::run() got called (and only once).

8 calls to DiagnosticCheckBase::runCheck()
DiagnosticCheckBase::getDescription in src/Plugin/Purge/DiagnosticCheck/DiagnosticCheckBase.php
Gets the description of the check.
DiagnosticCheckBase::getRecommendation in src/Plugin/Purge/DiagnosticCheck/DiagnosticCheckBase.php
Get a recommendation matching the severity level, may return NULL.
DiagnosticCheckBase::getRequirementsArray in src/Plugin/Purge/DiagnosticCheck/DiagnosticCheckBase.php
Generates a individual Drupal-like requirements array.
DiagnosticCheckBase::getRequirementsSeverity in src/Plugin/Purge/DiagnosticCheck/DiagnosticCheckBase.php
Get the severity level, expressed as a status_report severity.
DiagnosticCheckBase::getSeverity in src/Plugin/Purge/DiagnosticCheck/DiagnosticCheckBase.php
Get the severity level.

... See full list

File

src/Plugin/Purge/DiagnosticCheck/DiagnosticCheckBase.php, line 69

Class

DiagnosticCheckBase
Describes a diagnostic check that tests a specific purging requirement.

Namespace

Drupal\purge\Plugin\Purge\DiagnosticCheck

Code

protected function runCheck() {
  if (!is_null($this->severity)) {
    return;
  }
  $this->severity = $this
    ->run();
  if (!is_int($this->severity)) {
    $class = $this
      ->getPluginDefinition()['class'];
    throw new CheckNotImplementedCorrectly("Exected integer as return from {$class}::run()!");
  }
  if ($this->severity < -1 || $this->severity > 2) {
    $class = $this
      ->getPluginDefinition()['class'];
    throw new CheckNotImplementedCorrectly("Invalid const returned by {$class}::run()!");
  }
}