You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Remove wrong deprecation triggers for forms in the DI extension
When a form type provides a BC layer with old form names (all core types
do), the form registry will ask for type extensions registered on the
legacy name for BC, and trigger a warning if it finds any.
The DependencyInjectionExtension should not trigger warnings on its own
when being asked for such extensions (especially when it has none
registered).
Core extensions are also registered using the proper extended type
rather than legacy names.
@@ -43,14 +41,10 @@ public function getType($name)
43
41
thrownewInvalidArgumentException(sprintf('The field type "%s" is not registered with the service container.', $name));
44
42
}
45
43
46
-
if (isset($this->legacyNames[$name])) {
47
-
@trigger_error('Accessing form types by type name/service ID 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);
// BC: validate result of getName() for legacy names (non-FQCN)
53
-
if (isset($this->legacyNames[$name]) && $type->getName() !== $name) {
47
+
if ($name !== get_class($type) && $type->getName() !== $name) {
54
48
thrownewInvalidArgumentException(
55
49
sprintf('The type name specified for the service "%s" does not match the actual name. Expected "%s", given "%s"',
56
50
$this->typeServiceIds[$name],
@@ -65,23 +59,11 @@ public function getType($name)
65
59
66
60
publicfunctionhasType($name)
67
61
{
68
-
if (isset($this->typeServiceIds[$name])) {
69
-
if (isset($this->legacyNames[$name])) {
70
-
@trigger_error('Accessing form types by type name/service ID 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);
71
-
}
72
-
73
-
returntrue;
74
-
}
75
-
76
-
returnfalse;
62
+
returnisset($this->typeServiceIds[$name]);
77
63
}
78
64
79
65
publicfunctiongetTypeExtensions($name)
80
66
{
81
-
if (isset($this->legacyNames[$name])) {
82
-
@trigger_error('Accessing form types by type name/service ID 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);
83
-
}
84
-
85
67
$extensions = array();
86
68
87
69
if (isset($this->typeExtensionServiceIds[$name])) {
@@ -95,10 +77,6 @@ public function getTypeExtensions($name)
95
77
96
78
publicfunctionhasTypeExtensions($name)
97
79
{
98
-
if (isset($this->legacyNames[$name])) {
99
-
@trigger_error('Accessing form types by type name/service ID 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);
0 commit comments