| Conditions | 7 |
| Paths | 7 |
| Total Lines | 20 |
| Code Lines | 12 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 2 | ||
| Bugs | 1 | Features | 1 |
| 1 | <?php |
||
| 82 | public function getAsString($value) |
||
| 83 | { |
||
| 84 | if (is_string($value)) { |
||
| 85 | return $value; |
||
| 86 | } |
||
| 87 | if (is_bool($value)) { |
||
| 88 | return $value ? 'TRUE' : 'FALSE'; |
||
| 89 | } |
||
| 90 | if (is_null($value)) { |
||
| 91 | return 'NULL'; |
||
| 92 | } |
||
| 93 | if (is_resource($value)) { |
||
| 94 | return get_resource_type($value); |
||
| 95 | } |
||
| 96 | if (is_object($value)) { |
||
| 97 | return '{'.get_class($value).'}'; |
||
| 98 | } |
||
| 99 | |||
| 100 | return (string) $value; |
||
| 101 | } |
||
| 102 | } |
||
| 103 |
This check looks for
@paramannotations where the type inferred by our type inference engine differs from the declared type.It makes a suggestion as to what type it considers more descriptive.
Most often this is a case of a parameter that can be null in addition to its declared types.