1 | <?php |
||
14 | final class Denormalizer implements DenormalizerInterface |
||
15 | { |
||
16 | /** |
||
17 | * @var DenormalizerObjectMappingRegistryInterface |
||
18 | */ |
||
19 | private $denormalizerObjectMappingRegistry; |
||
20 | |||
21 | /** |
||
22 | * @var LoggerInterface |
||
23 | */ |
||
24 | private $logger; |
||
25 | |||
26 | /** |
||
27 | * @param DenormalizerObjectMappingRegistryInterface $denormalizerObjectMappingRegistry |
||
28 | * @param LoggerInterface|null $logger |
||
29 | */ |
||
30 | 10 | public function __construct( |
|
37 | |||
38 | /** |
||
39 | * @param object|string $object |
||
40 | * @param array $data |
||
41 | * @param DenormalizerContextInterface|null $context |
||
42 | * @param string $path |
||
43 | * |
||
44 | * @return object |
||
45 | * |
||
46 | * @throws DeserializerLogicException |
||
47 | * @throws DeserializerRuntimeException |
||
48 | */ |
||
49 | 10 | public function denormalize($object, array $data, DenormalizerContextInterface $context = null, string $path = '') |
|
79 | |||
80 | /** |
||
81 | * @param string $class |
||
82 | * |
||
83 | * @return DenormalizationObjectMappingInterface |
||
84 | * |
||
85 | * @throws DeserializerLogicException |
||
86 | */ |
||
87 | 10 | private function getObjectMapping(string $class): DenormalizationObjectMappingInterface |
|
97 | |||
98 | /** |
||
99 | * @param DenormalizationObjectMappingInterface $objectMapping |
||
100 | * @param string $path |
||
101 | * @param string|null $type |
||
102 | * |
||
103 | * @return object |
||
104 | */ |
||
105 | 8 | private function createNewObject( |
|
123 | |||
124 | /** |
||
125 | * @param DenormalizerContextInterface $context |
||
126 | * @param DenormalizationFieldMappingInterface $denormalizationFieldMapping |
||
127 | * @param string $path |
||
128 | * @param array $data |
||
129 | * @param object $object |
||
130 | */ |
||
131 | 8 | private function denormalizeField( |
|
155 | |||
156 | /** |
||
157 | * @param string $path |
||
158 | * @param array $names |
||
159 | */ |
||
160 | 1 | private function handleNotAllowedAdditionalFields(string $path, array $names) |
|
170 | |||
171 | /** |
||
172 | * @param DenormalizerContextInterface $context |
||
173 | * @param DenormalizationFieldMappingInterface $fieldMapping |
||
174 | * |
||
175 | * @return bool |
||
176 | */ |
||
177 | 7 | private function isWithinGroup( |
|
193 | |||
194 | /** |
||
195 | * @param string $path |
||
196 | * @param string $name |
||
197 | * |
||
198 | * @return string |
||
199 | */ |
||
200 | 6 | private function getSubPathByName(string $path, string $name): string |
|
204 | |||
205 | /** |
||
206 | * @param string $path |
||
207 | * @param array $names |
||
208 | * |
||
209 | * @return array |
||
210 | */ |
||
211 | 1 | private function getSubPathsByNames(string $path, array $names): array |
|
220 | } |
||
221 |