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 | * @return array |
||
42 | */ |
||
43 | public function normalize($object, NormalizerContextInterface $context = null, string $path = ''): array |
||
78 | |||
79 | /** |
||
80 | * @param object $object |
||
81 | * @param string $path |
||
82 | * @throws SerializerLogicException |
||
83 | */ |
||
84 | private function validateDataType($object, string $path) |
||
94 | |||
95 | /** |
||
96 | * @param string $class |
||
97 | * |
||
98 | * @return NormalizationObjectMappingInterface |
||
99 | * |
||
100 | * @throws SerializerLogicException |
||
101 | */ |
||
102 | private function getObjectMapping(string $class): NormalizationObjectMappingInterface |
||
112 | |||
113 | /** |
||
114 | * @param NormalizerContextInterface $context |
||
115 | * @param NormalizationFieldMappingInterface $normalizationFieldMapping |
||
116 | * @param string $path |
||
117 | * @param array $data |
||
118 | * @param $object |
||
119 | */ |
||
120 | private function normalizeField( |
||
141 | |||
142 | /** |
||
143 | * @param NormalizerContextInterface $context |
||
144 | * @param NormalizationFieldMappingInterface $fieldMapping |
||
145 | * |
||
146 | * @return bool |
||
147 | */ |
||
148 | private function isWithinGroup( |
||
164 | |||
165 | /** |
||
166 | * @param string $path |
||
167 | * @param string $name |
||
168 | * |
||
169 | * @return string |
||
170 | */ |
||
171 | private function getSubPathByName(string $path, string $name): string |
||
175 | } |
||
176 |