[Form] Add context to FormFactory deprecations
This commit is contained in:
parent
bc642fb633
commit
e2010d2fc1
|
@ -101,12 +101,12 @@ class FormFactory implements FormFactoryInterface
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($type instanceof FormTypeInterface) {
|
if ($type instanceof FormTypeInterface) {
|
||||||
@trigger_error('Passing type instances to FormBuilder::add(), Form::add() or the FormFactory is deprecated since version 2.8 and will not be supported in 3.0. Use the fully-qualified type class name instead.', E_USER_DEPRECATED);
|
@trigger_error(sprintf('Passing type instances to FormBuilder::add(), Form::add() or the FormFactory is deprecated since version 2.8 and will not be supported in 3.0. Use the fully-qualified type class name instead (%s).', get_class($type)), E_USER_DEPRECATED);
|
||||||
$type = $this->resolveType($type);
|
$type = $this->resolveType($type);
|
||||||
} elseif (is_string($type)) {
|
} elseif (is_string($type)) {
|
||||||
$type = $this->registry->getType($type);
|
$type = $this->registry->getType($type);
|
||||||
} elseif ($type instanceof ResolvedFormTypeInterface) {
|
} elseif ($type instanceof ResolvedFormTypeInterface) {
|
||||||
@trigger_error('Passing type instances to FormBuilder::add(), Form::add() or the FormFactory is deprecated since version 2.8 and will not be supported in 3.0. Use the fully-qualified type class name instead.', E_USER_DEPRECATED);
|
@trigger_error(sprintf('Passing type instances to FormBuilder::add(), Form::add() or the FormFactory is deprecated since version 2.8 and will not be supported in 3.0. Use the fully-qualified type class name instead (%s).', get_class($type->getInnerType())), E_USER_DEPRECATED);
|
||||||
} else {
|
} else {
|
||||||
throw new UnexpectedTypeException($type, 'string, Symfony\Component\Form\ResolvedFormTypeInterface or Symfony\Component\Form\FormTypeInterface');
|
throw new UnexpectedTypeException($type, 'string, Symfony\Component\Form\ResolvedFormTypeInterface or Symfony\Component\Form\FormTypeInterface');
|
||||||
}
|
}
|
||||||
|
|
Reference in New Issue