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
feature #22811 [DI] Remove deprecated case insensitive service ids (ro0NL)
This PR was squashed before being merged into the 4.0-dev branch (closes#22811).
Discussion
----------
[DI] Remove deprecated case insensitive service ids
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | no
| BC breaks? | yes
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | #... <!-- #-prefixed issue number(s), if any -->
| License | MIT
| Doc PR | symfony/symfony-docs#... <!--highly recommended for new features-->
See #21223
Commits
-------
63e26fc [DI] Remove deprecated case insensitive service ids
* The container can have three possible behaviors when a service does not exist:
51
32
*
@@ -70,11 +51,6 @@ class Container implements ResettableContainerInterface
70
51
protected$aliases = array();
71
52
protected$loading = array();
72
53
73
-
/**
74
-
* @internal
75
-
*/
76
-
protected$normalizedIds = array();
77
-
78
54
private$envCache = array();
79
55
private$compiled = false;
80
56
@@ -171,8 +147,6 @@ public function setParameter($name, $value)
171
147
*/
172
148
publicfunctionset($id, $service)
173
149
{
174
-
$id = $this->normalizeId($id);
175
-
176
150
if ('service_container' === $id) {
177
151
thrownewInvalidArgumentException('You cannot set service "service_container".');
178
152
}
@@ -212,31 +186,24 @@ public function set($id, $service)
212
186
*/
213
187
publicfunctionhas($id)
214
188
{
215
-
for ($i = 2;;) {
216
-
if (isset($this->privates[$id])) {
217
-
@trigger_error(sprintf('Checking for the existence of the "%s" private service is deprecated since Symfony 3.2 and won\'t be supported anymore in Symfony 4.0.', $id), E_USER_DEPRECATED);
218
-
}
219
-
if ('service_container' === $id) {
220
-
returntrue;
221
-
}
222
-
if (isset($this->aliases[$id])) {
223
-
$id = $this->aliases[$id];
224
-
}
225
-
if (isset($this->services[$id])) {
226
-
returntrue;
227
-
}
228
-
229
-
if (isset($this->methodMap[$id])) {
230
-
returntrue;
231
-
}
232
-
233
-
if (--$i && $id !== $normalizedId = $this->normalizeId($id)) {
234
-
$id = $normalizedId;
235
-
continue;
236
-
}
189
+
if (isset($this->privates[$id])) {
190
+
@trigger_error(sprintf('Checking for the existence of the "%s" private service is deprecated since Symfony 3.2 and won\'t be supported anymore in Symfony 4.0.', $id), E_USER_DEPRECATED);
@trigger_error(sprintf('Requesting the "%s" private service is deprecated since Symfony 3.2 and won\'t be supported anymore in Symfony 4.0.', $id), E_USER_DEPRECATED);
268
-
}
269
-
if ('service_container' === $id) {
270
-
return$this;
271
-
}
272
-
if (isset($this->aliases[$id])) {
273
-
$id = $this->aliases[$id];
274
-
}
228
+
if (isset($this->privates[$id])) {
229
+
@trigger_error(sprintf('Requesting the "%s" private service is deprecated since Symfony 3.2 and won\'t be supported anymore in Symfony 4.0.', $id), E_USER_DEPRECATED);
@trigger_error(sprintf('Service identifiers will be made case sensitive in Symfony 4.0. Using "%s" instead of "%s" is deprecated since version 3.3.', $id, $normalizedId), E_USER_DEPRECATED);
0 commit comments