| Conditions | 5 |
| Paths | 5 |
| Total Lines | 18 |
| Code Lines | 10 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 28 | public function parse($value, $annotation = null) |
||
| 29 | { |
||
| 30 | if ('' === $value) return true; // implicit boolean |
||
| 31 | |||
| 32 | $json = JsonType::jsonDecode($value); |
||
| 33 | |||
| 34 | if (JSON_ERROR_NONE === json_last_error()) { |
||
| 35 | return $json; |
||
| 36 | } |
||
| 37 | elseif (false !== ($int = filter_var($value, FILTER_VALIDATE_INT))) { |
||
| 38 | return $int; |
||
| 39 | } |
||
| 40 | elseif (false !== ($float = filter_var($value, FILTER_VALIDATE_FLOAT))) { |
||
| 41 | return $float; |
||
| 42 | } |
||
| 43 | |||
| 44 | return $value; |
||
| 45 | } |
||
| 46 | |||
| 48 |
Our type inference engine has found an assignment to a property that is incompatible with the declared type of that property.
Either this assignment is in error or the assigned type should be added to the documentation/type hint for that property..