| Conditions | 3 |
| Paths | 3 |
| Total Lines | 12 |
| Code Lines | 6 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 0 |
| CRAP Score | 12 |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 52 | protected function validateValue($model) |
||
| 53 | { |
||
| 54 | if (!$model instanceof Model) { |
||
| 55 | throw new InvalidParamException('Passed value must be instance of Model'); |
||
| 56 | } |
||
| 57 | |||
| 58 | if (!$model->validate()) { |
||
| 59 | return [reset($model->getFirstErrors()), []]; // todo: return more than one error |
||
| 60 | } |
||
| 61 | |||
| 62 | return null; |
||
| 63 | } |
||
| 64 | } |
||
| 65 |
This check looks for function or method calls that always return null and whose return value is assigned to a variable.
The method
getObject()can return nothing but null, so it makes no sense to assign that value to a variable.The reason is most likely that a function or method is imcomplete or has been reduced for debug purposes.