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 | 1 | 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 |
||
75 | |||
76 | /** |
||
77 | * @param object $object |
||
78 | * @param string $path |
||
79 | * |
||
80 | * @throws SerializerLogicException |
||
81 | */ |
||
82 | private function validateDataType($object, string $path) |
||
92 | |||
93 | /** |
||
94 | * @param string $class |
||
95 | * |
||
96 | * @return NormalizationObjectMappingInterface |
||
97 | * |
||
98 | * @throws SerializerLogicException |
||
99 | */ |
||
100 | private function getObjectMapping(string $class): NormalizationObjectMappingInterface |
||
110 | |||
111 | /** |
||
112 | * @param NormalizerContextInterface $context |
||
113 | * @param NormalizationFieldMappingInterface[] $normalizationFieldMappings |
||
114 | * @param string $path |
||
115 | * @param $object |
||
116 | * |
||
117 | * @return array |
||
118 | */ |
||
119 | private function getDataByFieldNormalizationMappings( |
||
144 | |||
145 | /** |
||
146 | * @param NormalizerContextInterface $context |
||
147 | * @param NormalizationFieldMappingInterface $fieldMapping |
||
148 | * |
||
149 | * @return bool |
||
150 | */ |
||
151 | private function isWithinGroup( |
||
167 | |||
168 | /** |
||
169 | * @param string $path |
||
170 | * @param string $name |
||
171 | * |
||
172 | * @return string |
||
173 | */ |
||
174 | private function getSubPathByName(string $path, string $name): string |
||
178 | } |
||
179 |