| Conditions | 5 |
| Paths | 5 |
| Total Lines | 21 |
| Code Lines | 17 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 2 | ||
| Bugs | 1 | Features | 0 |
| 1 | <?php |
||
| 32 | public function convertMB($value) |
||
| 33 | { |
||
| 34 | if (is_numeric($value)) { |
||
| 35 | return $value; |
||
| 36 | } else { |
||
| 37 | $value_length = strlen($value); |
||
| 38 | $qty = substr($value, 0, $value_length - 1); |
||
| 39 | $unit = strtolower(substr($value, $value_length - 1)); |
||
| 40 | switch ($unit) { |
||
| 41 | case 'k': |
||
| 42 | $qty /= 1024; |
||
| 43 | break; |
||
| 44 | case 'm': |
||
| 45 | $qty = $qty; |
||
| 46 | break; |
||
| 47 | case 'g': |
||
| 48 | $qty *= 1024; |
||
| 49 | break; |
||
| 50 | } |
||
| 51 | |||
| 52 | return $qty; |
||
| 53 | } |
||
| 56 |
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..