MCPcopy Create free account
hub / github.com/Rello/analytics / compareValues

Method compareValues

lib/Service/ThresholdService.php:166–173  ·  view source on GitHub ↗

* Compare two values and return comparison result similar to spaceship operator * * @param $a * @param $b * @return int */

($a, $b)

Source from the content-addressed store, hash-verified

164 * @return int
165 */
166 private function compareValues($a, $b) {
167 if (is_numeric($a) && is_numeric($b)) {
168 $normA = $this->normalizeNumberString((string)$a);
169 $normB = $this->normalizeNumberString((string)$b);
170 return floatval($normA) <=> floatval($normB);
171 }
172 return strcmp((string)$a, (string)$b);
173 }
174
175 /**
176 * Delete threshold

Callers 3

validateMethod · 0.95
matchesThresholdMethod · 0.95
visualization.jsFile · 0.80

Calls 1

normalizeNumberStringMethod · 0.95

Tested by

no test coverage detected