1 | <?php |
||
14 | final class Normalizer implements NormalizerInterface |
||
15 | { |
||
16 | /** |
||
17 | * @var NormalizerObjectMappingRegistryInterface |
||
18 | */ |
||
19 | private $normalizerObjectMappingRegistry; |
||
20 | |||
21 | /** |
||
22 | * @var LoggerInterface |
||
23 | */ |
||
24 | private $logger; |
||
25 | |||
26 | /** |
||
27 | * @param NormalizerObjectMappingRegistryInterface $normalizerObjectMappingRegistry |
||
28 | * @param LoggerInterface|null $logger |
||
29 | */ |
||
30 | 4 | public function __construct( |
|
37 | |||
38 | /** |
||
39 | * @param object $object |
||
40 | * @param NormalizerContextInterface|null $context |
||
41 | * @param string $path |
||
42 | * |
||
43 | * @return array |
||
44 | */ |
||
45 | 4 | public function normalize($object, NormalizerContextInterface $context = null, string $path = ''): array |
|
77 | |||
78 | /** |
||
79 | * @param object $object |
||
80 | * @param string $path |
||
81 | * |
||
82 | * @throws SerializerLogicException |
||
83 | */ |
||
84 | 4 | private function validateDataType($object, string $path) |
|
94 | |||
95 | /** |
||
96 | * @param string $class |
||
97 | * |
||
98 | * @return NormalizationObjectMappingInterface |
||
99 | * |
||
100 | * @throws SerializerLogicException |
||
101 | */ |
||
102 | 3 | private function getObjectMapping(string $class): NormalizationObjectMappingInterface |
|
112 | |||
113 | /** |
||
114 | * @param NormalizerContextInterface $context |
||
115 | * @param NormalizationFieldMappingInterface[] $normalizationFieldMappings |
||
116 | * @param string $path |
||
117 | * @param $object |
||
118 | * |
||
119 | * @return array |
||
120 | */ |
||
121 | 2 | private function getDataByFieldNormalizationMappings( |
|
146 | |||
147 | /** |
||
148 | * @param NormalizerContextInterface $context |
||
149 | * @param NormalizationLinkMappingInterface[] $linkMappings |
||
150 | * @param string $path |
||
151 | * @return array |
||
152 | */ |
||
153 | 2 | private function getLinksByLinkNormalizationMappings( |
|
170 | |||
171 | /** |
||
172 | * @param NormalizerContextInterface $context |
||
173 | * @param NormalizationFieldMappingInterface $fieldMapping |
||
174 | * |
||
175 | * @return bool |
||
176 | */ |
||
177 | 2 | private function isWithinGroup( |
|
193 | |||
194 | /** |
||
195 | * @param string $path |
||
196 | * @param string $name |
||
197 | * |
||
198 | * @return string |
||
199 | */ |
||
200 | 2 | private function getSubPathByName(string $path, string $name): string |
|
204 | } |
||
205 |