| Conditions | 3 |
| Paths | 2 |
| Total Lines | 15 |
| Code Lines | 7 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 0 |
| CRAP Score | 12 |
| Changes | 0 | ||
| 1 | <?php |
||
| 37 | public function create(Form $component): FormBuilderInterface |
||
| 38 | { |
||
| 39 | $builder = $this->formFactory->createBuilder($component->formType); |
||
| 40 | if (!($currentAction = $builder->getAction()) || '' === $currentAction) { |
||
| 41 | // Should we not be looking for the POST endpoint for the resource from API Platform instead of assuming this will be the name? |
||
| 42 | $action = $this->router->generate( |
||
| 43 | 'api_forms_post_item', |
||
| 44 | [ |
||
| 45 | 'id' => $component->getId(), |
||
| 46 | ] |
||
| 47 | ); |
||
| 48 | $builder->setAction($action); |
||
| 49 | } |
||
| 50 | |||
| 51 | return $builder; |
||
| 52 | } |
||
| 54 |