1 | <?php |
||
23 | final class UriConstraint extends Constraint |
||
24 | { |
||
25 | /** |
||
26 | * @var array |
||
27 | */ |
||
28 | private $allowedSchemes; |
||
29 | |||
30 | /** |
||
31 | * @var string |
||
32 | */ |
||
33 | private $basePath; |
||
34 | |||
35 | /** |
||
36 | * @var array |
||
37 | */ |
||
38 | private $templateParams; |
||
39 | |||
40 | /** |
||
41 | * @var array |
||
42 | */ |
||
43 | private $queryParams; |
||
44 | |||
45 | /** |
||
46 | * @var string |
||
47 | */ |
||
48 | private $host; |
||
49 | |||
50 | /** |
||
51 | * @var array |
||
52 | */ |
||
53 | private $errors = []; |
||
54 | |||
55 | /** |
||
56 | * @var string |
||
57 | */ |
||
58 | private $template; |
||
59 | |||
60 | /** |
||
61 | * @var Validator |
||
62 | */ |
||
63 | private $validator; |
||
64 | |||
65 | /** |
||
66 | * @param array $expectedSchemes |
||
67 | * @param string $host |
||
68 | * @param string $basePath |
||
69 | * @param string $template |
||
70 | * @param array $pathParams |
||
71 | * @param array $queryParams |
||
72 | */ |
||
73 | 9 | public function __construct( |
|
91 | |||
92 | /** |
||
93 | * {@inheritdoc} |
||
94 | */ |
||
95 | 9 | protected function matches($uri) |
|
178 | |||
179 | /** |
||
180 | * {@inheritdoc} |
||
181 | */ |
||
182 | 7 | protected function failureDescription($other) |
|
186 | |||
187 | /** |
||
188 | * {@inheritdoc} |
||
189 | */ |
||
190 | 7 | protected function additionalFailureDescription($other) |
|
202 | |||
203 | /** |
||
204 | * {@inheritdoc} |
||
205 | */ |
||
206 | 7 | public function toString() |
|
210 | |||
211 | /** |
||
212 | * @param UriInterface $uri |
||
213 | * |
||
214 | * @return array |
||
215 | */ |
||
216 | 7 | private static function normalizeUri(UriInterface $uri) |
|
224 | |||
225 | /** |
||
226 | * Ensure schema is object. |
||
227 | * |
||
228 | * @param object|array $schema |
||
229 | * |
||
230 | * @return object |
||
231 | */ |
||
232 | 9 | private static function normalizeJsonSchema($schema) |
|
236 | |||
237 | /** |
||
238 | * Cast numeric values, JSON validator does not do it. |
||
239 | * |
||
240 | * @param mixed $value |
||
241 | * |
||
242 | * @return mixed |
||
243 | */ |
||
244 | 5 | private static function normalizeNumericString($value) |
|
252 | |||
253 | /** |
||
254 | * Split string to segments by regexp. |
||
255 | * |
||
256 | * @param string $pattern |
||
257 | * @param string $subject |
||
258 | * |
||
259 | * @return array |
||
260 | */ |
||
261 | 7 | private static function splitString($pattern, $subject) |
|
265 | |||
266 | /** |
||
267 | * @param string $context |
||
268 | * |
||
269 | * @return Validator |
||
270 | */ |
||
271 | 9 | private static function createJsonValidator($context) |
|
281 | } |
||
282 |