Conditions | 4 |
Paths | 4 |
Total Lines | 16 |
Code Lines | 8 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
14 | public function execute() |
||
15 | { |
||
16 | $builder = $this->getBaseFormBuilder(); |
||
17 | /** @var \ReflectionClass $reflection */ |
||
18 | $reflection = $this->getFromResponse('reflection'); |
||
19 | |||
20 | foreach ($reflection->getProperties() as $property) { |
||
21 | if ($this->accessManager->canUpdateProperty($property)) { |
||
22 | if($annotation = $this->reader->getPropertyAnnotation($property, Form::class)) { |
||
23 | $builder->add($property->getName(), $annotation->type, $annotation->options); |
||
24 | } |
||
25 | $builder->add($property->getName()); |
||
26 | } |
||
27 | } |
||
28 | |||
29 | return $this->createResponse(['form' => $builder->getForm()]); |
||
30 | } |
||
37 | } |