| Conditions | 5 |
| Paths | 5 |
| Total Lines | 19 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 0 |
| CRAP Score | 30 |
| Changes | 0 | ||
| 1 | <?php |
||
| 54 | protected function populateRequest($request, $params) |
||
| 55 | { |
||
| 56 | foreach ($params as $param => $value) { |
||
| 57 | switch ($param) { |
||
| 58 | case 'module': |
||
| 59 | $request->setModuleName($value); |
||
| 60 | break; |
||
| 61 | case 'controller': |
||
| 62 | $request->setControllerName($value); |
||
| 63 | break; |
||
| 64 | case 'action': |
||
| 65 | $request->setActionName($value); |
||
| 66 | break; |
||
| 67 | default: |
||
| 68 | $request->attributes->set($param, $value); |
||
| 69 | break; |
||
| 70 | } |
||
| 71 | } |
||
| 72 | } |
||
| 73 | |||
| 82 |
It seems like the type of the argument is not accepted by the function/method which you are calling.
In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.
We suggest to add an explicit type cast like in the following example: