1 | <?php |
||
22 | class Walker |
||
23 | { |
||
24 | /** |
||
25 | * @var Registry |
||
26 | */ |
||
27 | private $registry; |
||
28 | |||
29 | /** |
||
30 | * @var Resolver |
||
31 | */ |
||
32 | private $resolver; |
||
33 | |||
34 | /** |
||
35 | * @var stdClass[] |
||
36 | */ |
||
37 | private $parsedSchemas = []; |
||
38 | |||
39 | /** |
||
40 | * @var stdClass[] |
||
41 | */ |
||
42 | private $resolvedSchemas = []; |
||
43 | |||
44 | /** |
||
45 | * @var Constraint[][] |
||
46 | */ |
||
47 | private $constraintsCacheA = []; |
||
48 | |||
49 | /** |
||
50 | * @var Constraint[][] |
||
51 | */ |
||
52 | private $constraintsCacheB = []; |
||
53 | |||
54 | /** |
||
55 | * Constructor. |
||
56 | * |
||
57 | * @param Registry $registry |
||
58 | * @param Resolver $resolver |
||
59 | */ |
||
60 | 485 | public function __construct(Registry $registry, Resolver $resolver) |
|
65 | |||
66 | /** |
||
67 | * Recursively resolve JSON pointer references within a given schema. |
||
68 | * |
||
69 | * @param stdClass $schema The schema to resolve |
||
70 | * @param Uri $uri The URI of the schema |
||
71 | * |
||
72 | * @return stdClass |
||
73 | */ |
||
74 | 299 | public function resolveReferences(stdClass $schema, Uri $uri) |
|
116 | |||
117 | /** |
||
118 | * Recursively normalizes a given schema and validates its syntax. |
||
119 | * |
||
120 | * @param stdClass $schema |
||
121 | * @param Context $context |
||
122 | * |
||
123 | * @return stdClass |
||
124 | */ |
||
125 | 357 | public function parseSchema(stdClass $schema, Context $context) |
|
148 | |||
149 | /** |
||
150 | * Validates an instance against a given schema, populating a context |
||
151 | * with encountered violations. |
||
152 | * |
||
153 | * @param mixed $instance |
||
154 | * @param stdClass $schema |
||
155 | * @param Context $context |
||
156 | */ |
||
157 | 348 | public function applyConstraints($instance, stdClass $schema, Context $context) |
|
196 | |||
197 | /** |
||
198 | * Checks if given schema has been already visited. |
||
199 | * |
||
200 | * @param stdClass $schema |
||
201 | * @param array $stack |
||
202 | * |
||
203 | * @return bool |
||
204 | */ |
||
205 | 363 | private function isLooping(stdClass $schema, array &$stack) |
|
215 | } |
||
216 |