Conditions | 5 |
Paths | 8 |
Total Lines | 12 |
Code Lines | 6 |
Lines | 0 |
Ratio | 0 % |
Tests | 6 |
CRAP Score | 5 |
Changes | 0 |
1 | <?php |
||
62 | 10 | public function parseValue($value) |
|
63 | { |
||
64 | 10 | $float = is_float($value) || is_int($value) ? floatval($value) : null; |
|
65 | |||
66 | 10 | if ($float === null || ! is_finite($float)) { |
|
67 | 6 | throw new Error( |
|
68 | 'Float cannot represent non numeric value: ' . |
||
69 | 6 | Utils::printSafe($value) |
|
70 | ); |
||
71 | } |
||
72 | |||
73 | 4 | return $float; |
|
74 | } |
||
94 |