Conditions | 3 |
Paths | 3 |
Total Lines | 15 |
Code Lines | 7 |
Lines | 0 |
Ratio | 0 % |
Tests | 8 |
CRAP Score | 3 |
Changes | 0 |
1 | <?php |
||
19 | |||
20 | public function execute() |
||
21 | { |
||
22 | /** @var \ReflectionClass $reflection */ |
||
23 | $reflection = $this->getFromResponse('reflection'); |
||
24 | $persistedEntity = $this->getFromResponse('response_data'); |
||
25 | |||
26 | $data = []; |
||
27 | |||
28 | foreach ($reflection->getProperties() as $property) { |
||
29 | if ($this->accessManager->canAccessProperty($property)) { |
||
30 | $data[Inflector::tableize($property->getName()] = call_user_func([$persistedEntity, 'get'.ucfirst($property->getName())]); |
||
|
|||
31 | } |
||
32 | } |
||
33 | |||
34 | return $this->createResponse(['response_data' => $data]); |
||
41 | } |