Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit e2010d2

Browse files
[Form] Add context to FormFactory deprecations
1 parent bc642fb commit e2010d2

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/Symfony/Component/Form/FormFactory.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -101,12 +101,12 @@ public function createNamedBuilder($name, $type = 'Symfony\Component\Form\Extens
101101
}
102102

103103
if ($type instanceof FormTypeInterface) {
104-
@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);
104+
@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);
105105
$type = $this->resolveType($type);
106106
} elseif (is_string($type)) {
107107
$type = $this->registry->getType($type);
108108
} elseif ($type instanceof ResolvedFormTypeInterface) {
109-
@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);
109+
@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);
110110
} else {
111111
throw new UnexpectedTypeException($type, 'string, Symfony\Component\Form\ResolvedFormTypeInterface or Symfony\Component\Form\FormTypeInterface');
112112
}

0 commit comments

Comments
 (0)