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

Method compareValues

lib/Service/ThresholdService.php:140–147  ·  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

138 * @return int
139 */
140 private function compareValues($a, $b) {
141 if (is_numeric($a) && is_numeric($b)) {
142 $normA = $this->normalizeNumberString((string)$a);
143 $normB = $this->normalizeNumberString((string)$b);
144 return floatval($normA) <=> floatval($normB);
145 }
146 return strcmp((string)$a, (string)$b);
147 }
148
149 /**
150 * Delete threshold

Callers 2

validateMethod · 0.95
visualization.jsFile · 0.80

Calls 1

normalizeNumberStringMethod · 0.95

Tested by

no test coverage detected