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 | 11 | 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 | 11 | public function denormalize($object, array $data, DenormalizerContextInterface $context = null, string $path = '') |
|
81 | |||
82 | /** |
||
83 | * @param string $class |
||
84 | * |
||
85 | * @return DenormalizationObjectMappingInterface |
||
86 | * |
||
87 | * @throws DeserializerLogicException |
||
88 | */ |
||
89 | 11 | private function getObjectMapping(string $class): DenormalizationObjectMappingInterface |
|
99 | |||
100 | /** |
||
101 | * @param DenormalizationObjectMappingInterface $objectMapping |
||
102 | * @param string $path |
||
103 | * @param string|null $type |
||
104 | * |
||
105 | * @return object |
||
106 | */ |
||
107 | 9 | private function createNewObject( |
|
125 | |||
126 | /** |
||
127 | * @param DenormalizerContextInterface $context |
||
128 | * @param DenormalizationFieldMappingInterface $fieldMapping |
||
129 | * @param string $path |
||
130 | * @param array $data |
||
131 | * @param object $object |
||
132 | */ |
||
133 | 9 | private function denormalizeField( |
|
163 | |||
164 | /** |
||
165 | * @param DenormalizationFieldMappingInterface $fieldMapping |
||
166 | * @param mixed $value |
||
167 | * |
||
168 | * @return mixed |
||
169 | */ |
||
170 | 6 | private function forceType(DenormalizationFieldMappingInterface $fieldMapping, $value) |
|
199 | |||
200 | /** |
||
201 | * @param string $path |
||
202 | * @param array $names |
||
203 | */ |
||
204 | 2 | private function handleNotAllowedAdditionalFields(string $path, array $names) |
|
214 | |||
215 | /** |
||
216 | * @param DenormalizerContextInterface $context |
||
217 | * @param DenormalizationFieldMappingInterface $fieldMapping |
||
218 | * |
||
219 | * @return bool |
||
220 | */ |
||
221 | 7 | private function isWithinGroup( |
|
237 | |||
238 | /** |
||
239 | * @param string $path |
||
240 | * @param string|int $name |
||
241 | * |
||
242 | * @return string |
||
243 | */ |
||
244 | 7 | private function getSubPathByName(string $path, $name): string |
|
248 | |||
249 | /** |
||
250 | * @param string $path |
||
251 | * @param array $names |
||
252 | * |
||
253 | * @return array |
||
254 | */ |
||
255 | 2 | private function getSubPathsByNames(string $path, array $names): array |
|
264 | } |
||
265 |