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 | public function __construct( |
||
36 | |||
37 | /** |
||
38 | * @param object $object |
||
39 | * @param NormalizerContextInterface|null $context |
||
40 | * @param string $path |
||
41 | * |
||
42 | * @return array |
||
43 | */ |
||
44 | public function normalize($object, NormalizerContextInterface $context = null, string $path = ''): array |
||
83 | |||
84 | /** |
||
85 | * @param object $object |
||
86 | * @param string $path |
||
87 | * |
||
88 | * @throws SerializerLogicException |
||
89 | */ |
||
90 | private function validateDataType($object, string $path) |
||
100 | |||
101 | /** |
||
102 | * @param string $class |
||
103 | * |
||
104 | * @return NormalizationObjectMappingInterface |
||
105 | * |
||
106 | * @throws SerializerLogicException |
||
107 | */ |
||
108 | private function getObjectMapping(string $class): NormalizationObjectMappingInterface |
||
118 | |||
119 | /** |
||
120 | * @param NormalizerContextInterface $context |
||
121 | * @param NormalizationFieldMappingInterface[] $normalizationFieldMappings |
||
122 | * @param string $path |
||
123 | * @param $object |
||
124 | * |
||
125 | * @return array |
||
126 | */ |
||
127 | private function getDataByFieldNormalizationMappings( |
||
152 | |||
153 | /** |
||
154 | * @param NormalizerContextInterface $context |
||
155 | * @param NormalizationFieldMappingInterface $fieldMapping |
||
156 | * |
||
157 | * @return bool |
||
158 | */ |
||
159 | private function isWithinGroup( |
||
175 | |||
176 | /** |
||
177 | * @param string $path |
||
178 | * @param string $name |
||
179 | * |
||
180 | * @return string |
||
181 | */ |
||
182 | private function getSubPathByName(string $path, string $name): string |
||
186 | } |
||
187 |