1 | <?php |
||
5 | class RequestBuilder |
||
6 | { |
||
7 | |||
8 | private $defaults = [ |
||
9 | 'get' => [], |
||
10 | 'post' => [], |
||
11 | 'server' => [], |
||
12 | 'files' => [], |
||
13 | 'cookies'=> [], |
||
14 | ]; |
||
15 | |||
16 | private $parsers = []; |
||
17 | |||
18 | |||
19 | /** |
||
20 | * @param array[] $params |
||
21 | * @return Routable |
||
22 | */ |
||
23 | 15 | public function create($params) |
|
37 | |||
38 | |||
39 | /** |
||
40 | * @param string $type |
||
41 | * @param callback $parser |
||
42 | */ |
||
43 | 5 | public function addContentParser($type, $parser) |
|
47 | |||
48 | |||
49 | 2 | protected function buildInstance() |
|
56 | |||
57 | |||
58 | /** |
||
59 | * @param Request $instance |
||
60 | */ |
||
61 | 7 | protected function applyContentParsers($instance) |
|
79 | |||
80 | /** |
||
81 | * @param callable $parser |
||
82 | * @param string $type |
||
83 | * @param Headers\ContentType $header |
||
84 | */ |
||
85 | 3 | private function alterParameters($parser, $type, $header) |
|
96 | |||
97 | |||
98 | /** |
||
99 | * @param Request $instance |
||
100 | * @param array[] $params |
||
101 | */ |
||
102 | 3 | protected function applyParams($instance, $params) |
|
114 | |||
115 | |||
116 | /** |
||
117 | * @param Request $instance |
||
118 | * @param array[] $params |
||
119 | */ |
||
120 | 1 | protected function applyWebContext($instance, $params) |
|
129 | |||
130 | |||
131 | /** |
||
132 | * @param Request $instance |
||
133 | * @param array $params |
||
134 | */ |
||
135 | 2 | protected function applyHeaders($instance, $params) |
|
149 | } |
||
150 |
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: