1 | <?php |
||
14 | final class Denormalizer implements DenormalizerInterface |
||
15 | { |
||
16 | /** |
||
17 | * @var DenormalizingObjectMappingInterface[] |
||
18 | */ |
||
19 | private $objectMappings; |
||
20 | |||
21 | /** |
||
22 | * @var LoggerInterface |
||
23 | */ |
||
24 | private $logger; |
||
25 | |||
26 | /** |
||
27 | * @param array $objectMappings |
||
28 | * @param LoggerInterface|null $logger |
||
29 | */ |
||
30 | 8 | public function __construct(array $objectMappings, LoggerInterface $logger = null) |
|
39 | |||
40 | /** |
||
41 | * @param DenormalizingObjectMappingInterface $objectMapping |
||
42 | */ |
||
43 | 7 | private function addObjectMapping(DenormalizingObjectMappingInterface $objectMapping) |
|
47 | |||
48 | /** |
||
49 | * @param object|string $object |
||
50 | * @param array $data |
||
51 | * @param DenormalizerContextInterface|null $context |
||
52 | * @param string $path |
||
53 | * |
||
54 | * @return object |
||
55 | * |
||
56 | * @throws DeserializerLogicException |
||
57 | * @throws DeserializerRuntimeException |
||
58 | */ |
||
59 | 8 | public function denormalize($object, array $data, DenormalizerContextInterface $context = null, string $path = '') |
|
87 | |||
88 | /** |
||
89 | * @param string $class |
||
90 | * |
||
91 | * @return DenormalizingObjectMappingInterface |
||
92 | */ |
||
93 | 8 | private function getObjectMapping(string $class): DenormalizingObjectMappingInterface |
|
105 | |||
106 | /** |
||
107 | * @param DenormalizerContextInterface $context |
||
108 | * @param DenormalizingFieldMappingInterface $denormalizingFieldMapping |
||
109 | * @param string $path |
||
110 | * @param array $data |
||
111 | * @param $object |
||
112 | */ |
||
113 | 7 | private function denormalizeField( |
|
137 | |||
138 | /** |
||
139 | * @param string $path |
||
140 | * @param $names |
||
141 | */ |
||
142 | 1 | private function handleNotAllowedAddtionalFields(string $path, $names) |
|
152 | |||
153 | /** |
||
154 | * @param DenormalizerContextInterface $context |
||
155 | * @param DenormalizingFieldMappingInterface $fieldMapping |
||
156 | * |
||
157 | * @return bool |
||
158 | */ |
||
159 | 6 | private function isWithinGroup( |
|
175 | |||
176 | /** |
||
177 | * @param string $path |
||
178 | * @param string $name |
||
179 | * |
||
180 | * @return string |
||
181 | */ |
||
182 | 5 | private function getSubPathByName(string $path, string $name): string |
|
186 | |||
187 | /** |
||
188 | * @param string $path |
||
189 | * @param array $names |
||
190 | * |
||
191 | * @return array |
||
192 | */ |
||
193 | 1 | private function getSubPathsByNames(string $path, array $names): array |
|
202 | } |
||
203 |