From e2010d2fc10d73a4afc5a94cc01d589847e66826 Mon Sep 17 00:00:00 2001 From: Nicolas Grekas Date: Wed, 2 Dec 2015 14:02:15 +0100 Subject: [PATCH] [Form] Add context to FormFactory deprecations --- src/Symfony/Component/Form/FormFactory.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Symfony/Component/Form/FormFactory.php b/src/Symfony/Component/Form/FormFactory.php index f7160d5507..048705f142 100644 --- a/src/Symfony/Component/Form/FormFactory.php +++ b/src/Symfony/Component/Form/FormFactory.php @@ -101,12 +101,12 @@ class FormFactory implements FormFactoryInterface } 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); } elseif (is_string($type)) { $type = $this->registry->getType($type); } 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 { throw new UnexpectedTypeException($type, 'string, Symfony\Component\Form\ResolvedFormTypeInterface or Symfony\Component\Form\FormTypeInterface'); }