You are here

public function DiagnosticsService::isSystemOnFire in Purge 8.3

Reports if any of the diagnostic checks report a SEVERITY_ERROR severity.

This method provides a simple - boolean evaluable - way to determine if a DiagnosticCheckInterface::SEVERITY_ERROR severity was reported by one of the checks. If SEVERITY_ERROR was reported, purging cannot continue and should happen once all problems are resolved.

Return value

false|\Drupal\purge\Plugin\Purge\DiagnosticCheck\DiagnosticCheckInterface The SEVERITY_ERROR reporting check, or FALSE when everything was fine.

Overrides DiagnosticsServiceInterface::isSystemOnFire

File

src/Plugin/Purge/DiagnosticCheck/DiagnosticsService.php, line 215

Class

DiagnosticsService
Provides a service that interacts with diagnostic checks.

Namespace

Drupal\purge\Plugin\Purge\DiagnosticCheck

Code

public function isSystemOnFire() {
  $this
    ->initializePluginInstances();
  foreach ($this as $check) {
    if ($check
      ->getSeverity() === DiagnosticCheckInterface::SEVERITY_ERROR) {
      return $check;
    }
  }
  return FALSE;
}