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 string $class |
||
94 | * @param mixed $value |
||
95 | * @param string $name |
||
96 | * |
||
97 | * @return mixed|null |
||
98 | */ |
||
99 | protected static function buildObjectParameter($class, $value, $name) |
||
117 | |||
118 | /** |
||
119 | * {@inheritdoc} |
||
120 | */ |
||
121 | public function serialize() |
||
142 | |||
143 | /** |
||
144 | * Normalize value. |
||
145 | * |
||
146 | * @param $value |
||
147 | * |
||
148 | * @return array|string |
||
149 | */ |
||
150 | protected function normalize($value) |
||
162 | |||
163 | /** |
||
164 | * @param array $data |
||
165 | * |
||
166 | * @return array |
||
167 | */ |
||
168 | protected function resolveFlat(array $data) |
||
182 | |||
183 | /** |
||
184 | * Check if property is internal use (@internal annotation). |
||
185 | * |
||
186 | * @param ReflectionProperty $property |
||
187 | * |
||
188 | * @return bool |
||
189 | */ |
||
190 | protected function isInternal(ReflectionProperty $property) |
||
194 | } |
||
195 |