1 | <?php |
||
13 | final class Normalizer implements NormalizerInterface |
||
14 | { |
||
15 | /** |
||
16 | * @var NormalizerObjectMappingRegistryInterface |
||
17 | */ |
||
18 | private $normalizerObjectMappingRegistry; |
||
19 | |||
20 | /** |
||
21 | * @var LoggerInterface |
||
22 | */ |
||
23 | private $logger; |
||
24 | |||
25 | /** |
||
26 | * @param NormalizerObjectMappingRegistryInterface $normalizerObjectMappingRegistry |
||
27 | * @param LoggerInterface|null $logger |
||
28 | */ |
||
29 | 4 | public function __construct( |
|
36 | |||
37 | /** |
||
38 | * @param object $object |
||
39 | * @param NormalizerContextInterface|null $context |
||
40 | * @param string $path |
||
41 | * |
||
42 | * @return array |
||
43 | */ |
||
44 | 4 | public function normalize($object, NormalizerContextInterface $context = null, string $path = ''): array |
|
69 | |||
70 | /** |
||
71 | * @param object $object |
||
72 | * @param string $path |
||
73 | * |
||
74 | * @throws SerializerLogicException |
||
75 | */ |
||
76 | 4 | private function validateDataType($object, string $path) |
|
86 | |||
87 | /** |
||
88 | * @param string $class |
||
89 | * |
||
90 | * @return NormalizationObjectMappingInterface |
||
91 | * |
||
92 | * @throws SerializerLogicException |
||
93 | */ |
||
94 | 3 | private function getObjectMapping(string $class): NormalizationObjectMappingInterface |
|
104 | |||
105 | /** |
||
106 | * @param NormalizerContextInterface $context |
||
107 | * @param NormalizationFieldMappingInterface[] $normalizationFieldMappings |
||
108 | * @param string $path |
||
109 | * @param $object |
||
110 | * |
||
111 | * @return array |
||
112 | */ |
||
113 | 2 | private function getDataByFieldNormalizationMappings( |
|
138 | |||
139 | /** |
||
140 | * @param NormalizerContextInterface $context |
||
141 | * @param NormalizationFieldMappingInterface $fieldMapping |
||
142 | * |
||
143 | * @return bool |
||
144 | */ |
||
145 | 2 | private function isWithinGroup( |
|
161 | |||
162 | /** |
||
163 | * @param string $path |
||
164 | * @param string $name |
||
165 | * |
||
166 | * @return string |
||
167 | */ |
||
168 | 2 | private function getSubPathByName(string $path, string $name): string |
|
172 | } |
||
173 |