1 | <?php |
||
24 | abstract class AbstractVisitor implements VisitorInterface |
||
25 | { |
||
26 | /** |
||
27 | * @var \SplStack |
||
28 | */ |
||
29 | private $dataStack; |
||
30 | |||
31 | /** |
||
32 | * @var \SplStack |
||
33 | */ |
||
34 | private $metadataStack; |
||
35 | |||
36 | /** |
||
37 | * @var NavigatorInterface |
||
38 | */ |
||
39 | protected $navigator; |
||
40 | |||
41 | /** |
||
42 | * {@inheritdoc} |
||
43 | */ |
||
44 | public function prepare($data, ContextInterface $context) |
||
52 | |||
53 | /** |
||
54 | * {@inheritdoc} |
||
55 | */ |
||
56 | public function visitArray($data, TypeMetadataInterface $type, ContextInterface $context) |
||
69 | |||
70 | /** |
||
71 | * {@inheritdoc} |
||
72 | */ |
||
73 | public function visitBoolean($data, TypeMetadataInterface $type, ContextInterface $context) |
||
77 | |||
78 | /** |
||
79 | * {@inheritdoc} |
||
80 | */ |
||
81 | public function visitFloat($data, TypeMetadataInterface $type, ContextInterface $context) |
||
85 | |||
86 | /** |
||
87 | * {@inheritdoc} |
||
88 | */ |
||
89 | public function visitInteger($data, TypeMetadataInterface $type, ContextInterface $context) |
||
93 | |||
94 | /** |
||
95 | * {@inheritdoc} |
||
96 | */ |
||
97 | public function visitNull($data, TypeMetadataInterface $type, ContextInterface $context) |
||
101 | |||
102 | /** |
||
103 | * {@inheritdoc} |
||
104 | */ |
||
105 | public function visitResource($data, TypeMetadataInterface $type, ContextInterface $context) |
||
109 | |||
110 | /** |
||
111 | * {@inheritdoc} |
||
112 | */ |
||
113 | public function visitString($data, TypeMetadataInterface $type, ContextInterface $context) |
||
117 | |||
118 | /** |
||
119 | * {@inheritdoc} |
||
120 | */ |
||
121 | public function startVisitingObject($data, ClassMetadataInterface $class, ContextInterface $context) |
||
131 | |||
132 | /** |
||
133 | * {@inheritdoc} |
||
134 | */ |
||
135 | public function visitObjectProperty($data, PropertyMetadataInterface $property, ContextInterface $context) |
||
152 | |||
153 | /** |
||
154 | * {@inheritdoc} |
||
155 | */ |
||
156 | public function finishVisitingObject($data, ClassMetadataInterface $class, ContextInterface $context) |
||
160 | |||
161 | /** |
||
162 | * @param mixed $data |
||
163 | * @param TypeMetadataInterface $type |
||
164 | * @param ContextInterface $context |
||
165 | * |
||
166 | * @return mixed |
||
167 | */ |
||
168 | abstract protected function doVisitArray($data, TypeMetadataInterface $type, ContextInterface $context); |
||
169 | |||
170 | /** |
||
171 | * @param mixed $data |
||
172 | * @param string $name |
||
173 | * @param PropertyMetadataInterface $property |
||
174 | * @param ContextInterface $context |
||
175 | * |
||
176 | * @return bool |
||
177 | */ |
||
178 | abstract protected function doVisitObjectProperty( |
||
184 | |||
185 | /** |
||
186 | * @param mixed $data |
||
187 | * @param MetadataInterface $metadata |
||
188 | */ |
||
189 | private function enterScope($data, MetadataInterface $metadata) |
||
194 | |||
195 | private function leaveScope() |
||
200 | } |
||
201 |