Conditions | 6 |
Paths | 7 |
Total Lines | 11 |
Code Lines | 9 |
Lines | 0 |
Ratio | 0 % |
Changes | 2 | ||
Bugs | 1 | Features | 0 |
1 | <?php |
||
52 | private function generateMappings(object $object): Generator |
||
53 | { |
||
54 | foreach ($this->config as $key => $value) { |
||
55 | $k = $value === true ? $key : $value; |
||
56 | $hasProperty = property_exists($object, $k); |
||
57 | $hasMethod = method_exists($object, $k); |
||
58 | if ($hasProperty || $hasMethod) { |
||
59 | $hydrationKey = new HydrationKey($k); |
||
60 | yield $k => $hasProperty |
||
61 | ? new PropertyMapping(new ReflectionProperty($object, $value), $hydrationKey) |
||
62 | : new MethodMapping(new ReflectionMethod($object, $value), $hydrationKey); |
||
63 | } |
||
67 |