Total Complexity | 5 |
Total Lines | 23 |
Duplicated Lines | 0 % |
Changes | 0 |
1 | <?php |
||
12 | class BuildUpdateFormStep extends AbstractBuildFormStep |
||
13 | { |
||
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 | } |
||
31 | |||
32 | public function requiresBefore() |
||
35 | } |
||
36 | |||
37 | } |