| Conditions | 5 |
| Paths | 5 |
| Total Lines | 27 |
| Code Lines | 20 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 52 | private static function castValue($value, $model) |
||
| 53 | { |
||
| 54 | switch (gettype($value)) { |
||
| 55 | case 'int': |
||
| 56 | case 'integer': |
||
| 57 | $model->value_int = $value; |
||
| 58 | $model->value_str = null; |
||
| 59 | $model->value_bool = null; |
||
| 60 | |||
| 61 | return $model; |
||
| 62 | break; |
||
|
|
|||
| 63 | |||
| 64 | case 'bool': |
||
| 65 | case 'boolean': |
||
| 66 | $model->value_int = null; |
||
| 67 | $model->value_str = null; |
||
| 68 | $model->value_bool = $value; |
||
| 69 | |||
| 70 | return $model; |
||
| 71 | break; |
||
| 72 | |||
| 73 | default: |
||
| 74 | $model->value_int = null; |
||
| 75 | $model->value_str = $value; |
||
| 76 | $model->value_bool = null; |
||
| 77 | |||
| 78 | return $model; |
||
| 79 | } |
||
| 82 |
The
breakstatement is not necessary if it is preceded for example by areturnstatement:If you would like to keep this construct to be consistent with other
casestatements, you can safely mark this issue as a false-positive.