1 | <?php |
||
11 | class RouteMatcher |
||
12 | { |
||
13 | /** |
||
14 | * @var null|array $arguments arguments for the callback, extracted |
||
15 | * from path |
||
16 | * @var string $methodMatched the matched method. |
||
17 | * @var string $pathMatched the matched path. |
||
18 | */ |
||
19 | public $arguments = []; |
||
20 | public $methodMatched; |
||
21 | public $pathMatched; |
||
22 | |||
23 | |||
24 | |||
25 | /** |
||
26 | * Check if part of route is a argument and optionally match type |
||
27 | * as a requirement {argument:type}. |
||
28 | * |
||
29 | * @param string $rulePart the rule part to check. |
||
30 | * @param string $queryPart the query part to check. |
||
31 | * @param array &$args add argument to args array if matched |
||
32 | * |
||
33 | * @return boolean |
||
34 | */ |
||
35 | private function checkPartAsArgument($rulePart, $queryPart, &$args) |
||
54 | |||
55 | |||
56 | |||
57 | /** |
||
58 | * Check if value is matching a certain type of values. |
||
59 | * |
||
60 | * @param string $value the value to check. |
||
61 | * @param array $type the expected type to check against. |
||
62 | * |
||
63 | * @return boolean |
||
64 | */ |
||
65 | private function checkPartMatchingType($value, $type) |
||
88 | |||
89 | |||
90 | |||
91 | /** |
||
92 | * Check if value is matching a certain type and do type |
||
93 | * conversion accordingly. |
||
94 | * |
||
95 | * @param string $value the value to check. |
||
96 | * @param array $type the expected type to check against. |
||
97 | * |
||
98 | * @return boolean |
||
99 | */ |
||
100 | private function typeConvertArgument($value, $type) |
||
111 | |||
112 | |||
113 | |||
114 | /** |
||
115 | * Match part of rule and query. |
||
116 | * |
||
117 | * @param string $rulePart the rule part to check. |
||
118 | * @param string $queryPart the query part to check. |
||
119 | * @param array &$args add argument to args array if matched |
||
120 | * |
||
121 | * @return boolean |
||
122 | */ |
||
123 | private function matchPart($rulePart, $queryPart, &$args) |
||
142 | |||
143 | |||
144 | |||
145 | /** |
||
146 | * Check if the request method matches. |
||
147 | * |
||
148 | * @param string $method as request method. |
||
149 | * @param string $supported as request methods that are valid. |
||
150 | * |
||
151 | * @return boolean true if request method matches |
||
152 | */ |
||
153 | private function matchRequestMethod( |
||
163 | |||
164 | |||
165 | |||
166 | /** |
||
167 | * Check if the route matches a query and request method. |
||
168 | * |
||
169 | * @param string $path of the current route being matched. |
||
170 | * @param string $query to match against |
||
171 | * @param array $methodSupported as supported request method |
||
172 | * @param string $method as request method |
||
173 | * |
||
174 | * @return boolean true if query matches the route |
||
175 | */ |
||
176 | public function match( |
||
223 | } |
||
224 |
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: