mirror of
https://github.com/kevinveenbirkenbach/infinito.git
synced 2025-09-13 13:57:10 +02:00
Renamed FormBuilder to FormFactory and implemented test draft for CreateSourceAction
This commit is contained in:
@@ -41,7 +41,7 @@ final class CreateSourceAction extends AbstractCreateAction
|
||||
*/
|
||||
protected function isValidByForm(): bool
|
||||
{
|
||||
$this->actionService->getForm();
|
||||
return $this->actionService->getCurrentFormBuilder()->getForm()->isValid();
|
||||
}
|
||||
|
||||
/**
|
||||
|
@@ -4,6 +4,7 @@ namespace App\Domain\FormManagement;
|
||||
|
||||
use Symfony\Component\Form\FormBuilderInterface;
|
||||
use App\Domain\RequestManagement\Action\RequestedActionInterface;
|
||||
use Symfony\Component\Form\FormFactoryInterface;
|
||||
|
||||
/**
|
||||
* @author kevinfrantz
|
||||
@@ -11,9 +12,9 @@ use App\Domain\RequestManagement\Action\RequestedActionInterface;
|
||||
class RequestedActionFormBuilder implements RequestedActionFormBuilderInterface
|
||||
{
|
||||
/**
|
||||
* @var FormBuilderInterface
|
||||
* @var FormFactoryInterface
|
||||
*/
|
||||
private $formBuilder;
|
||||
private $formFactory;
|
||||
|
||||
/**
|
||||
* @var FormClassNameServiceInterface
|
||||
@@ -21,12 +22,12 @@ class RequestedActionFormBuilder implements RequestedActionFormBuilderInterface
|
||||
private $formClassNameService;
|
||||
|
||||
/**
|
||||
* @param FormBuilderInterface $formBuilder
|
||||
* @param FormFactoryInterface $formFactory
|
||||
* @param FormClassNameServiceInterface $formClassNameService
|
||||
*/
|
||||
public function __construct(FormBuilderInterface $formBuilder, FormClassNameServiceInterface $formClassNameService)
|
||||
public function __construct(FormFactoryInterface $formFactory, FormClassNameServiceInterface $formClassNameService)
|
||||
{
|
||||
$this->formBuilder = $formBuilder;
|
||||
$this->formFactory = $formFactory;
|
||||
$this->formClassNameService = $formClassNameService;
|
||||
}
|
||||
|
||||
@@ -44,7 +45,7 @@ class RequestedActionFormBuilder implements RequestedActionFormBuilderInterface
|
||||
if ($requestedEntity->hasIdentity()) {
|
||||
$entity = $requestedEntity->getEntity();
|
||||
}
|
||||
$form = $this->formBuilder->create($class, $entity);
|
||||
$form = $this->formFactory->createBuilder($class, $entity);
|
||||
|
||||
return $form;
|
||||
}
|
||||
|
@@ -4,6 +4,8 @@ namespace App\Domain\FormManagement;
|
||||
|
||||
use Symfony\Component\Form\FormBuilderInterface;
|
||||
use App\Domain\RequestManagement\Action\RequestedActionServiceInterface;
|
||||
use FOS\UserBundle\Form\Factory\FormFactory;
|
||||
use Symfony\Component\Form\FormFactoryInterface;
|
||||
|
||||
/**
|
||||
* @author kevinfrantz
|
||||
@@ -20,9 +22,9 @@ final class RequestedActionFormBuilderService extends RequestedActionFormBuilder
|
||||
*
|
||||
* @see \App\Domain\FormManagement\RequestedActionFormBuilder::__construct()
|
||||
*/
|
||||
public function __construct(FormBuilderInterface $formBuilder, FormClassNameServiceInterface $formClassNameService, RequestedActionServiceInterface $requestedActionService)
|
||||
public function __construct(FormFactoryInterface $formFactory, FormClassNameServiceInterface $formClassNameService, RequestedActionServiceInterface $requestedActionService)
|
||||
{
|
||||
parent::__construct($formBuilder, $formClassNameService);
|
||||
parent::__construct($formFactory, $formClassNameService);
|
||||
$this->requestedActionService = $requestedActionService;
|
||||
}
|
||||
|
||||
|
@@ -9,5 +9,9 @@ use App\Form\AbstractType;
|
||||
*/
|
||||
class SourceType extends AbstractType
|
||||
{
|
||||
/**
|
||||
* @deprecated
|
||||
* @var string
|
||||
*/
|
||||
const CLASS_PARAMETER_NAME = 'class';
|
||||
}
|
||||
|
Reference in New Issue
Block a user