Conditions | 2 |
Paths | 2 |
Total Lines | 13 |
Code Lines | 7 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
33 | public static function getPropertyMapping(string $className): array |
||
34 | { |
||
35 | try { |
||
36 | $properties = (new \ReflectionClass($className))->getProperties(); |
||
37 | } catch (\ReflectionException) { |
||
38 | $properties = []; |
||
39 | } |
||
40 | |||
41 | $map = static fn (\ReflectionProperty $p): array => [ |
||
42 | SerializerHelper::getSerializedNameAttribute($p)->getSerializedName() => $p->getType()?->getName(), |
||
|
|||
43 | ]; |
||
44 | |||
45 | return array_merge(...array_map($map, $properties)); |
||
46 | } |
||
58 |