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