1 | <?php |
||
14 | final class Denormalizer implements DenormalizerInterface |
||
15 | { |
||
16 | /** |
||
17 | * @var DenormalizationObjectMappingInterface[] |
||
18 | */ |
||
19 | private $objectMappings; |
||
20 | |||
21 | /** |
||
22 | * @var array |
||
23 | */ |
||
24 | private $classToTypeMappings; |
||
25 | |||
26 | /** |
||
27 | * @var LoggerInterface |
||
28 | */ |
||
29 | private $logger; |
||
30 | |||
31 | /** |
||
32 | * @param array $objectMappings |
||
33 | * @param LoggerInterface|null $logger |
||
34 | */ |
||
35 | 8 | public function __construct(array $objectMappings, LoggerInterface $logger = null) |
|
45 | |||
46 | /** |
||
47 | * @param DenormalizationObjectMappingInterface $objectMapping |
||
48 | */ |
||
49 | 7 | private function addObjectMapping(DenormalizationObjectMappingInterface $objectMapping) |
|
53 | |||
54 | /** |
||
55 | * @param object|string $object |
||
56 | * @param array $data |
||
57 | * @param DenormalizerContextInterface|null $context |
||
58 | * @param string $path |
||
59 | * |
||
60 | * @return object |
||
61 | * |
||
62 | * @throws DeserializerLogicException |
||
63 | * @throws DeserializerRuntimeException |
||
64 | */ |
||
65 | 8 | public function denormalize($object, array $data, DenormalizerContextInterface $context = null, string $path = '') |
|
96 | |||
97 | /** |
||
98 | * @param string $class |
||
99 | * |
||
100 | * @return DenormalizationObjectMappingInterface |
||
101 | * |
||
102 | * @throws DeserializerLogicException |
||
103 | */ |
||
104 | 8 | private function getObjectMapping(string $class): DenormalizationObjectMappingInterface |
|
116 | |||
117 | /** |
||
118 | * @param DenormalizerContextInterface $context |
||
119 | * @param DenormalizationFieldMappingInterface $denormalizationFieldMapping |
||
120 | * @param string $path |
||
121 | * @param array $data |
||
122 | * @param object $object |
||
123 | */ |
||
124 | 7 | private function denormalizeField( |
|
148 | |||
149 | /** |
||
150 | * @param string $path |
||
151 | * @param array $names |
||
152 | */ |
||
153 | 1 | private function handleNotAllowedAddtionalFields(string $path, array $names) |
|
163 | |||
164 | /** |
||
165 | * @param DenormalizerContextInterface $context |
||
166 | * @param DenormalizationFieldMappingInterface $fieldMapping |
||
167 | * |
||
168 | * @return bool |
||
169 | */ |
||
170 | 6 | private function isWithinGroup( |
|
186 | |||
187 | /** |
||
188 | * @param string $path |
||
189 | * @param string $name |
||
190 | * |
||
191 | * @return string |
||
192 | */ |
||
193 | 5 | private function getSubPathByName(string $path, string $name): string |
|
197 | |||
198 | /** |
||
199 | * @param string $path |
||
200 | * @param array $names |
||
201 | * |
||
202 | * @return array |
||
203 | */ |
||
204 | 1 | private function getSubPathsByNames(string $path, array $names): array |
|
213 | } |
||
214 |