Closed
Description
In Symfony 3 there's no other way to add dependencies to form types, then defining them as services. Those who want to use the form bundle stand alone, have no chance to have some dependency injected to the type, since Symfony itself handles the instantiation inside the form factory.
I'd like to suggest to let the clients use an instance of a FormTypeInterface
as the first parameter in the FormFactory::create()
method (or an FQCN string as it's now) and internally don't create other instance of the type. This way whenever you need the FQCN you can have it with get_class($formType)
, but client's still able to provide their own dependencies without registering services.