Skip to content

Commit d082732

Browse files
feature #34170 Re-allow to use "tagged" in service definitions (dunglas)
This PR was merged into the 4.4 branch. Discussion ---------- Re-allow to use "tagged" in service definitions | Q | A | ------------- | --- | Branch? | 4.4 | Bug fix? | no | New feature? | yes <!-- please update src/**/CHANGELOG.md files --> | Deprecations? | no <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files --> | Tickets | n/a | License | MIT | Doc PR | n/a Re-allow to use `tagged` in 4.4 and 5.0. It makes it easier for bundles to support both Symfony 4.3- and Symfony 4.4+. Needed to make API Platform compatible with Symfony 5 (api-platform/core#3009) Commits ------- 7b7dc0d Re-allow to use "tagged" in service definitions
2 parents 380e0fc + 7b7dc0d commit d082732

File tree

3 files changed

+1
-7
lines changed

3 files changed

+1
-7
lines changed

src/Symfony/Component/DependencyInjection/Loader/XmlFileLoader.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -502,8 +502,6 @@ private function getArgumentsAsPhp(\DOMElement $node, string $name, string $file
502502
}
503503
break;
504504
case 'tagged':
505-
@trigger_error(sprintf('Type "%s" of tag <%s> in "%s" is deprecated since Symfony 4.4 and will be removed in 5.0, use "tagged_iterator" instead.', $arg->getAttribute('type'), $name, $file), E_USER_DEPRECATED);
506-
// no break
507505
case 'tagged_iterator':
508506
case 'tagged_locator':
509507
$type = $arg->getAttribute('type');

src/Symfony/Component/DependencyInjection/Loader/YamlFileLoader.php

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -742,10 +742,6 @@ private function resolveServices($value, string $file, bool $isParameter = false
742742
}
743743
}
744744
if (\in_array($value->getTag(), ['tagged', 'tagged_iterator', 'tagged_locator'], true)) {
745-
if ('tagged' === $value->getTag()) {
746-
@trigger_error('"!tagged" is deprecated since Symfony 4.4 and will be removed in 5.0, use "!tagged_iterator" instead.', E_USER_DEPRECATED);
747-
}
748-
749745
$forLocator = 'tagged_locator' === $value->getTag();
750746

751747
if (\is_array($argument) && isset($argument['tag']) && $argument['tag']) {

src/Symfony/Component/DependencyInjection/Loader/schema/dic/services/services-1.0.xsd

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -265,7 +265,7 @@
265265
<xsd:enumeration value="constant" />
266266
<xsd:enumeration value="iterator" />
267267
<xsd:enumeration value="service_locator" />
268-
<!-- "tagged" is deprecated since Symfony 4.4 and will be removed in 5.0, use "tagged_iterator" instead. -->
268+
<!-- "tagged" is an alias of "tagged_iterator", using "tagged_iterator" is preferred. -->
269269
<xsd:enumeration value="tagged" />
270270
<xsd:enumeration value="tagged_iterator" />
271271
<xsd:enumeration value="tagged_locator" />

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy