Perfdata: simplify code design

refs #8194
This commit is contained in:
Alexander A. Klimov 2016-04-27 11:35:44 +02:00 committed by Johannes Meyer
parent e006902254
commit 7865db9053
1 changed files with 3 additions and 3 deletions

View File

@ -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;
}