1 | <?php |
||
15 | final class Normalizer implements NormalizerInterface |
||
16 | { |
||
17 | /** |
||
18 | * @var NormalizerObjectMappingRegistryInterface |
||
19 | */ |
||
20 | private $normalizerObjectMappingRegistry; |
||
21 | |||
22 | /** |
||
23 | * @var LoggerInterface |
||
24 | */ |
||
25 | private $logger; |
||
26 | |||
27 | /** |
||
28 | * @param NormalizerObjectMappingRegistryInterface $normalizerObjectMappingRegistry |
||
29 | * @param LoggerInterface|null $logger |
||
30 | */ |
||
31 | 4 | public function __construct( |
|
38 | |||
39 | /** |
||
40 | * @param Request $request |
||
41 | * @param object $object |
||
42 | * @param NormalizerContextInterface|null $context |
||
43 | * @param string $path |
||
44 | * |
||
45 | * @return array |
||
46 | */ |
||
47 | 4 | public function normalize( |
|
82 | |||
83 | /** |
||
84 | * @param object $object |
||
85 | * @param string $path |
||
86 | * |
||
87 | * @throws SerializerLogicException |
||
88 | */ |
||
89 | 4 | private function validateDataType($object, string $path) |
|
99 | |||
100 | /** |
||
101 | * @param string $class |
||
102 | * |
||
103 | * @return NormalizationObjectMappingInterface |
||
104 | * |
||
105 | * @throws SerializerLogicException |
||
106 | */ |
||
107 | 3 | private function getObjectMapping(string $class): NormalizationObjectMappingInterface |
|
117 | |||
118 | /** |
||
119 | * @param NormalizerContextInterface $context |
||
120 | * @param NormalizationFieldMappingInterface[] $normalizationFieldMappings |
||
121 | * @param string $path |
||
122 | * @param Request $request |
||
123 | * @param $object |
||
124 | * |
||
125 | * @return array |
||
126 | */ |
||
127 | 2 | private function getFieldsByFieldNormalizationMappings( |
|
153 | |||
154 | /** |
||
155 | * @param NormalizerContextInterface $context |
||
156 | * @param NormalizationLinkMappingInterface[] $normalizationLinkMappings |
||
157 | * @param string $path |
||
158 | * @param Request $request |
||
159 | * @param object $object |
||
160 | * |
||
161 | * @return array |
||
162 | */ |
||
163 | 2 | private function getLinksByLinkNormalizationMappings( |
|
187 | |||
188 | /** |
||
189 | * @param NormalizerContextInterface $context |
||
190 | * @param NormalizationFieldMappingInterface|NormalizationLinkMappingInterface $mapping |
||
191 | * |
||
192 | * @return bool |
||
193 | */ |
||
194 | 2 | private function isWithinGroup(NormalizerContextInterface $context, $mapping): bool |
|
208 | |||
209 | /** |
||
210 | * @param string $path |
||
211 | * @param string $name |
||
212 | * |
||
213 | * @return string |
||
214 | */ |
||
215 | 2 | private function getSubPathByName(string $path, string $name): string |
|
219 | } |
||
220 |