Conditions | 5 |
Paths | 5 |
Total Lines | 19 |
Lines | 19 |
Ratio | 100 % |
Tests | 0 |
CRAP Score | 30 |
Changes | 0 |
1 | <?php |
||
56 | View Code Duplication | protected function populateRequest($request, $params) |
|
57 | { |
||
58 | foreach ($params as $param => $value) { |
||
59 | switch ($param) { |
||
60 | case 'module': |
||
61 | $request->setModuleName($value); |
||
62 | break; |
||
63 | case 'controller': |
||
64 | $request->setControllerName($value); |
||
65 | break; |
||
66 | case 'action': |
||
67 | $request->setActionName($value); |
||
68 | break; |
||
69 | default: |
||
70 | $request->attributes->set($param, $value); |
||
71 | break; |
||
72 | } |
||
73 | } |
||
74 | } |
||
75 | |||
84 |
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: