You are here

public function SensorResult::getExpectedValue in Monitoring 8

Same name and namespace in other branches
  1. 7 lib/Drupal/monitoring/Result/SensorResult.php \Drupal\monitoring\Result\SensorResult::getExpectedValue()

Gets the sensor expected value.

Return value

mixed Whatever value the sensor is supposed to return.

Overrides SensorResultInterface::getExpectedValue

3 calls to SensorResult::getExpectedValue()
SensorResult::assessComparison in src/Result/SensorResult.php
Performs comparison of expected and actual sensor values.
SensorResult::compile in src/Result/SensorResult.php
Compiles added status messages sets the status.
SensorResult::toArray in src/Result/SensorResult.php
Returns sensor result data as array.

File

src/Result/SensorResult.php, line 371

Class

SensorResult
Generic container for the sensor result.

Namespace

Drupal\monitoring\Result

Code

public function getExpectedValue() {
  if ($this
    ->getSensorConfig()
    ->isBool()) {
    return (bool) $this
      ->getResultData('sensor_expected_value');
  }
  return $this
    ->getResultData('sensor_expected_value');
}