You are here

protected function UpdateStatusSensorPlugin::getStatusText in Monitoring 8

Gets status text.

Parameters

int $status: One of UpdateManagerInterface::* constants.

Return value

string Status text.

2 calls to UpdateStatusSensorPlugin::getStatusText()
UpdateStatusSensorPlugin::checkContrib in src/Plugin/monitoring/SensorPlugin/UpdateStatusSensorPlugin.php
Checks contrib status and sets sensor status message.
UpdateStatusSensorPlugin::checkCore in src/Plugin/monitoring/SensorPlugin/UpdateStatusSensorPlugin.php
Checks core status and sets sensor status message.

File

src/Plugin/monitoring/SensorPlugin/UpdateStatusSensorPlugin.php, line 143
Contains \Drupal\monitoring\Plugin\monitoring\SensorPlugin\UpdateStatusSensorPlugin.

Class

UpdateStatusSensorPlugin
Monitors for available updates of Drupal core and installed contrib modules.

Namespace

Drupal\monitoring\Plugin\monitoring\SensorPlugin

Code

protected function getStatusText($status) {
  switch ($status) {
    case UpdateManagerInterface::NOT_SECURE:
      return 'NOT SECURE';
      break;
    case UpdateManagerInterface::CURRENT:
      return 'current';
      break;
    case UpdateManagerInterface::REVOKED:
      return 'version revoked';
      break;
    case UpdateManagerInterface::NOT_SUPPORTED:
      return 'not supported';
      break;
    case UpdateManagerInterface::NOT_CURRENT:
      return 'update available';
      break;
    case UpdateFetcherInterface::UNKNOWN:
    case UpdateFetcherInterface::NOT_CHECKED:
    case UpdateFetcherInterface::NOT_FETCHED:
    case UpdateFetcherInterface::FETCH_PENDING:
      return 'unknown';
      break;
  }
}