From 7865db90534f5a52969ead3ac6556fd0ddbffb2c Mon Sep 17 00:00:00 2001 From: "Alexander A. Klimov" Date: Wed, 27 Apr 2016 11:35:44 +0200 Subject: [PATCH] Perfdata: simplify code design refs #8194 --- modules/monitoring/library/Monitoring/Plugin/Perfdata.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/modules/monitoring/library/Monitoring/Plugin/Perfdata.php b/modules/monitoring/library/Monitoring/Plugin/Perfdata.php index 6ffaf181f..e753768e6 100644 --- a/modules/monitoring/library/Monitoring/Plugin/Perfdata.php +++ b/modules/monitoring/library/Monitoring/Plugin/Perfdata.php @@ -111,7 +111,7 @@ class Perfdata { if (empty($perfdata)) { throw new InvalidArgumentException('Perfdata::fromString expects a string with content'); - } elseif (false === strpos($perfdata, '=')) { + } elseif (strpos($perfdata, '=') === false) { throw new InvalidArgumentException( 'Perfdata::fromString expects a key=value formatted string. Got "' . $perfdata . '" instead' ); @@ -211,8 +211,8 @@ class Perfdata } if ($this->maxValue !== null) { - $minValue = $this->minValue !== null ? $this->minValue : 0; - if ((float) ($this->maxValue - $minValue) === 0.0) { + $minValue = $this->minValue !== null ? $this->minValue : 0.0; + if ($this->maxValue == $minValue) { return null; }