1 | <?php |
||
15 | final class Denormalizer implements DenormalizerInterface |
||
16 | { |
||
17 | /** |
||
18 | * @var DenormalizerObjectMappingRegistryInterface |
||
19 | */ |
||
20 | private $denormalizerObjectMappingRegistry; |
||
21 | |||
22 | /** |
||
23 | * @var LoggerInterface |
||
24 | */ |
||
25 | private $logger; |
||
26 | |||
27 | /** |
||
28 | * @param DenormalizerObjectMappingRegistryInterface $denormalizerObjectMappingRegistry |
||
29 | * @param LoggerInterface|null $logger |
||
30 | */ |
||
31 | 12 | public function __construct( |
|
38 | |||
39 | /** |
||
40 | * @param object|string $object |
||
41 | * @param array $data |
||
42 | * @param DenormalizerContextInterface|null $context |
||
43 | * @param string $path |
||
44 | * |
||
45 | * @return object |
||
46 | * |
||
47 | * @throws DeserializerLogicException |
||
48 | * @throws DeserializerRuntimeException |
||
49 | */ |
||
50 | 12 | public function denormalize($object, array $data, DenormalizerContextInterface $context = null, string $path = '') |
|
93 | |||
94 | /** |
||
95 | * @param string $class |
||
96 | * |
||
97 | * @return DenormalizationObjectMappingInterface |
||
98 | * |
||
99 | * @throws DeserializerLogicException |
||
100 | */ |
||
101 | 12 | private function getObjectMapping(string $class): DenormalizationObjectMappingInterface |
|
111 | |||
112 | /** |
||
113 | * @param DenormalizationObjectMappingInterface $objectMapping |
||
114 | * @param string $path |
||
115 | * @param string|null $type |
||
116 | * |
||
117 | * @return object |
||
118 | */ |
||
119 | 9 | private function createNewObject( |
|
137 | |||
138 | /** |
||
139 | * @param DenormalizerContextInterface $context |
||
140 | * @param DenormalizationFieldMappingInterface $denormalizationFieldMapping |
||
141 | * @param string $path |
||
142 | * @param array $data |
||
143 | * @param object $object |
||
144 | */ |
||
145 | 7 | private function denormalizeField( |
|
166 | |||
167 | /** |
||
168 | * @param string $path |
||
169 | * @param array $names |
||
170 | */ |
||
171 | 2 | private function handleNotAllowedAdditionalFields(string $path, array $names) |
|
181 | |||
182 | /** |
||
183 | * @param DenormalizerContextInterface $context |
||
184 | * @param DenormalizationFieldMappingInterface $fieldMapping |
||
185 | * |
||
186 | * @return bool |
||
187 | */ |
||
188 | 7 | private function isWithinGroup( |
|
204 | |||
205 | /** |
||
206 | * @param string $path |
||
207 | * @param string|int $name |
||
208 | * |
||
209 | * @return string |
||
210 | */ |
||
211 | 7 | private function getSubPathByName(string $path, $name): string |
|
215 | |||
216 | /** |
||
217 | * @param string $path |
||
218 | * @param array $names |
||
219 | * |
||
220 | * @return array |
||
221 | */ |
||
222 | 2 | private function getSubPathsByNames(string $path, array $names): array |
|
231 | |||
232 | /** |
||
233 | * @param DenormalizerContextInterface $context |
||
234 | * @param object $object |
||
235 | * @param array $missingFields |
||
236 | */ |
||
237 | 8 | private function resetMissingFields(DenormalizerContextInterface $context, $object, array $missingFields) |
|
258 | } |
||
259 |