If you give class names which require constructor arguments, the FormTypeParser fails with fatal error when calling supports.
allow to pass classes wich have constructor arguments
Congrats on the insane hack ;) Looks alright to me but I'll let @willdurand check it out and merge because I'm not very familiar with that part of the code.
If your class as some required constructor arguments, you should be using the type name instead.
your hack will indeed allow to build the object, but will still break stuff as the type will not have its dependencies and so will break when using it.
$item ? There is no such variable
@stof I agree about the fact that when parsing the form, we should have a valid object instance.
Maybe should we just keep the hack for the supports method ?
This way, the fatal error would be triggered only when it's actually a real form type.
fix bad variable name
@docteurklein supports should check if the class is implementing FormTypeInterface in case it is a class name or an object instead (and call the form factory only when passing a string considered as type name).
And to have a real check, it could even check if the constructor can be called in case a class name is passed (i.e. does not have mandatory arguments).
@stof there is another problem when creating the form: required options.
do not support form types with required options
Wrong CS here
please remove the empty lines here
any news ?
Thank you, and sorry for the delay.
no problem! thanks :)