| Conditions | 4 |
| Paths | 2 |
| Total Lines | 16 |
| Code Lines | 8 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 60 | public function add($line) |
||
| 61 | { |
||
| 62 | if ( |
||
| 63 | !is_numeric($line) || |
||
| 64 | ( |
||
| 65 | isset($this->value) && |
||
| 66 | $this->value > 0 |
||
| 67 | ) |
||
| 68 | ) { |
||
| 69 | return false; |
||
| 70 | } |
||
| 71 | // PHP hack to convert numeric string to float or int |
||
| 72 | // http://stackoverflow.com/questions/16606364/php-cast-string-to-either-int-or-float |
||
| 73 | $this->value = $line + 0; |
||
| 74 | return true; |
||
| 75 | } |
||
| 76 | |||
| 98 |