| Conditions | 3 |
| Paths | 3 |
| Total Lines | 17 |
| Code Lines | 13 |
| Lines | 17 |
| Ratio | 100 % |
| Changes | 1 | ||
| Bugs | 1 | Features | 0 |
| 1 | <?php |
||
| 33 | protected function fixValue() |
||
| 34 | { |
||
| 35 | parent::fixValue(); |
||
| 36 | switch (strtolower($this->value)) { |
||
| 37 | case 'inf': |
||
| 38 | $this->value = INF; |
||
| 39 | return; |
||
| 40 | case '-inf': |
||
| 41 | $this->value = -INF; |
||
| 42 | return; |
||
| 43 | default: |
||
| 44 | $this->value = filter_var($this->value, FILTER_VALIDATE_FLOAT, ['options' => [ |
||
| 45 | 'default' => 'NaN', // value to return if the filter fails |
||
| 46 | 'decimal' => '.' |
||
| 47 | ]]); |
||
| 48 | } |
||
| 49 | } |
||
| 50 | protected function isOK() |
||
| 55 |
Classes in PHP are usually named in CamelCase.
In camelCase names are written without any punctuation, the start of each new word being marked by a capital letter. The whole name starts with a capital letter as well.
Thus the name database provider becomes
DatabaseProvider.