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 = '') |
|
97 | |||
98 | /** |
||
99 | * @param string $class |
||
100 | * |
||
101 | * @return DenormalizationObjectMappingInterface |
||
102 | * |
||
103 | * @throws DeserializerLogicException |
||
104 | */ |
||
105 | 12 | private function getObjectMapping(string $class): DenormalizationObjectMappingInterface |
|
115 | |||
116 | /** |
||
117 | * @param DenormalizationObjectMappingInterface $objectMapping |
||
118 | * @param string $path |
||
119 | * @param string|null $type |
||
120 | * |
||
121 | * @return object |
||
122 | */ |
||
123 | 9 | private function createNewObject( |
|
141 | |||
142 | /** |
||
143 | * @param DenormalizerContextInterface $context |
||
144 | * @param DenormalizationFieldMappingInterface $denormalizationFieldMapping |
||
145 | * @param string $path |
||
146 | * @param array $data |
||
147 | * @param object $object |
||
148 | */ |
||
149 | 7 | private function denormalizeField( |
|
170 | |||
171 | /** |
||
172 | * @param string $path |
||
173 | * @param array $names |
||
174 | */ |
||
175 | 2 | private function handleNotAllowedAdditionalFields(string $path, array $names) |
|
185 | |||
186 | /** |
||
187 | * @param DenormalizerContextInterface $context |
||
188 | * @param DenormalizationFieldMappingInterface $fieldMapping |
||
189 | * |
||
190 | * @return bool |
||
191 | */ |
||
192 | 7 | private function isWithinGroup( |
|
208 | |||
209 | /** |
||
210 | * @param string $path |
||
211 | * @param string|int $name |
||
212 | * |
||
213 | * @return string |
||
214 | */ |
||
215 | 7 | private function getSubPathByName(string $path, $name): string |
|
219 | |||
220 | /** |
||
221 | * @param string $path |
||
222 | * @param array $names |
||
223 | * |
||
224 | * @return array |
||
225 | */ |
||
226 | 2 | private function getSubPathsByNames(string $path, array $names): array |
|
235 | |||
236 | /** |
||
237 | * @param DenormalizerContextInterface $context |
||
238 | * @param DenormalizationObjectMappingInterface $objectMapping |
||
239 | * @param object $object |
||
240 | * @param array $missingFields |
||
241 | * @param string $path |
||
242 | * @param string|null $type |
||
243 | */ |
||
244 | 2 | private function resetMissingFields( |
|
265 | } |
||
266 |