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