for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
declare(strict_types=1);
namespace Linio\Controller;
use Symfony\Component\Form\Extension\Core\Type\FormType;
use Symfony\Component\Form\Form;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\Form\FormFactory;
use Symfony\Component\Form\FormTypeInterface;
trait FormAware
{
/**
* @var FormFactory
*/
protected $formFactory;
* @return FormFactory
public function getFormFactory()
return $this->formFactory;
}
* @param FormFactory $formFactory
public function setFormFactory(FormFactory $formFactory)
$this->formFactory = $formFactory;
* Creates and returns a Form instance from the type of the form.
*
* @param string|FormTypeInterface $type The built type of the form
* @param mixed $data The initial data for the form
* @param array $options Options for the form
* @return Form
public function createForm($type, $data = null, array $options = [])
return $this->formFactory->create($type, $data, $options);
* Creates and returns a form builder instance.
* @return FormBuilderInterface
public function createFormBuilder($data = null, array $options = [])
return $this->formFactory->createBuilder(FormType::class, $data, $options);