1 | <?php |
||
26 | trait SerializerTrait |
||
27 | { |
||
28 | use DataTypeCasterTrait; |
||
29 | |||
30 | /** |
||
31 | * {@inheritdoc} |
||
32 | * |
||
33 | * @return static |
||
34 | */ |
||
35 | public static function deserialize(ParameterBag $data) |
||
48 | |||
49 | /** |
||
50 | * Build parameters. |
||
51 | * |
||
52 | * @param ReflectionParameter[] $parameters |
||
53 | * @param ParameterBag $data |
||
54 | * |
||
55 | * @return array |
||
56 | */ |
||
57 | protected static function buildParameters(array $parameters, ParameterBag $data) |
||
66 | |||
67 | /** |
||
68 | * Build value. |
||
69 | * |
||
70 | * @param ReflectionParameter $parameter |
||
71 | * @param ParameterBag $data |
||
72 | * |
||
73 | * @return array|mixed|null |
||
74 | */ |
||
75 | protected static function buildValue(ReflectionParameter $parameter, ParameterBag $data) |
||
89 | |||
90 | /** |
||
91 | * Build object parameter. |
||
92 | * |
||
93 | * @param ReflectionClass $class |
||
94 | * @param mixed $value |
||
95 | * @param string $name |
||
96 | * |
||
97 | * @return mixed|null |
||
98 | */ |
||
99 | protected static function buildObjectParameter(ReflectionClass $class, $value, $name) |
||
125 | |||
126 | /** |
||
127 | * {@inheritdoc} |
||
128 | */ |
||
129 | public function serialize() |
||
150 | |||
151 | /** |
||
152 | * Normalize value. |
||
153 | * |
||
154 | * @param $value |
||
155 | * |
||
156 | * @return array|string |
||
157 | */ |
||
158 | protected function normalize($value) |
||
170 | |||
171 | /** |
||
172 | * @param array $data |
||
173 | * |
||
174 | * @return array |
||
175 | */ |
||
176 | protected function resolveFlat(array $data) |
||
190 | |||
191 | /** |
||
192 | * Check if property is internal use (@internal annotation). |
||
193 | * |
||
194 | * @param ReflectionProperty $property |
||
195 | * |
||
196 | * @return bool |
||
197 | */ |
||
198 | protected function isInternal(ReflectionProperty $property) |
||
202 | } |
||
203 |