Conditions | 3 |
Paths | 3 |
Total Lines | 13 |
Code Lines | 9 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
11 | public function validateValue($val) |
||
12 | { |
||
13 | if (!is_numeric($val)) { |
||
14 | throw $this->getValidationException("value must be numeric", $val); |
||
15 | } else { |
||
16 | $intVal = (integer)$val; |
||
17 | if ($intVal != (float)$val) { |
||
18 | throw $this->getValidationException("value must be an integer", $val); |
||
19 | } else { |
||
20 | return $intVal; |
||
21 | } |
||
22 | } |
||
23 | } |
||
24 | |||
29 | } |