diff --git a/UPGRADE-8.0.md b/UPGRADE-8.0.md index b2a23ec3c3678..198e3598934e3 100644 --- a/UPGRADE-8.0.md +++ b/UPGRADE-8.0.md @@ -122,7 +122,7 @@ DependencyInjection public function __construct(#[AutowireIterator('app.my_tag')] private iterable $services) {} } ``` - + * Remove `!tagged` tag, use `!tagged_iterator` instead * Remove the `ContainerBuilder::getAutoconfiguredAttributes()` method, use `getAttributeAutoconfigurators()` instead to retrieve all the callbacks for a specific attribute class DoctrineBridge diff --git a/src/Symfony/Component/DependencyInjection/CHANGELOG.md b/src/Symfony/Component/DependencyInjection/CHANGELOG.md index ac1f7d9239289..363b6e9906046 100644 --- a/src/Symfony/Component/DependencyInjection/CHANGELOG.md +++ b/src/Symfony/Component/DependencyInjection/CHANGELOG.md @@ -6,6 +6,7 @@ CHANGELOG * Remove `#[TaggedIterator]` and `#[TaggedLocator]` attributes, replaced by `#[AutowireLocator]` and `#[AutowireIterator]` * Remove `ContainerBuilder::getAutoconfiguredAttributes()`, replaced by `ContainerBuilder::getAttributeAutoconfigurators()` + * Remove `!tagged` tag, use `!tagged_iterator` instead 7.4 --- diff --git a/src/Symfony/Component/DependencyInjection/Loader/XmlFileLoader.php b/src/Symfony/Component/DependencyInjection/Loader/XmlFileLoader.php index 069d16d4facbe..466868f8b9b3f 100644 --- a/src/Symfony/Component/DependencyInjection/Loader/XmlFileLoader.php +++ b/src/Symfony/Component/DependencyInjection/Loader/XmlFileLoader.php @@ -630,9 +630,6 @@ private function getArgumentsAsPhp(\DOMElement $node, string $name, string $file $arg = $this->getArgumentsAsPhp($arg, $name, $file); $arguments[$key] = new ServiceLocatorArgument($arg); break; - case 'tagged': - trigger_deprecation('symfony/dependency-injection', '7.2', 'Type "tagged" is deprecated for tag <%s>, use "tagged_iterator" instead in "%s".', $name, $file); - // no break case 'tagged_iterator': case 'tagged_locator': $forLocator = 'tagged_locator' === $type; diff --git a/src/Symfony/Component/DependencyInjection/Loader/YamlFileLoader.php b/src/Symfony/Component/DependencyInjection/Loader/YamlFileLoader.php index 8d2b677fae8e9..736b0f7be0822 100644 --- a/src/Symfony/Component/DependencyInjection/Loader/YamlFileLoader.php +++ b/src/Symfony/Component/DependencyInjection/Loader/YamlFileLoader.php @@ -852,11 +852,7 @@ private function resolveServices(mixed $value, string $file, bool $isParameter = return new ServiceLocatorArgument($argument); } - if (\in_array($value->getTag(), ['tagged', 'tagged_iterator', 'tagged_locator'], true)) { - if ('tagged' === $value->getTag()) { - trigger_deprecation('symfony/dependency-injection', '7.2', 'Using "!tagged" is deprecated, use "!tagged_iterator" instead in "%s".', $file); - } - + if (\in_array($value->getTag(), ['tagged_iterator', 'tagged_locator'], true)) { $forLocator = 'tagged_locator' === $value->getTag(); if (\is_array($argument) && isset($argument['tag']) && $argument['tag']) { diff --git a/src/Symfony/Component/DependencyInjection/Tests/Fixtures/xml/services_with_deprecated_tagged.xml b/src/Symfony/Component/DependencyInjection/Tests/Fixtures/xml/services_with_deprecated_tagged.xml deleted file mode 100644 index 976450e18f46f..0000000000000 --- a/src/Symfony/Component/DependencyInjection/Tests/Fixtures/xml/services_with_deprecated_tagged.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - - - - diff --git a/src/Symfony/Component/DependencyInjection/Tests/Loader/XmlFileLoaderTest.php b/src/Symfony/Component/DependencyInjection/Tests/Loader/XmlFileLoaderTest.php index f962fa1062bb5..1390397a40c6d 100644 --- a/src/Symfony/Component/DependencyInjection/Tests/Loader/XmlFileLoaderTest.php +++ b/src/Symfony/Component/DependencyInjection/Tests/Loader/XmlFileLoaderTest.php @@ -1335,19 +1335,6 @@ public function testUnknownConstantAsKey() $loader->load('key_type_wrong_constant.xml'); } - /** - * @group legacy - */ - public function testDeprecatedTagged() - { - $container = new ContainerBuilder(); - $loader = new XmlFileLoader($container, new FileLocator(self::$fixturesPath.'/xml')); - - $this->expectUserDeprecationMessage(\sprintf('Since symfony/dependency-injection 7.2: Type "tagged" is deprecated for tag , use "tagged_iterator" instead in "%s/xml%sservices_with_deprecated_tagged.xml".', self::$fixturesPath, \DIRECTORY_SEPARATOR)); - - $loader->load('services_with_deprecated_tagged.xml'); - } - public function testLoadServicesWithEnvironment() { $container = new ContainerBuilder(); diff --git a/src/Symfony/Component/DependencyInjection/Tests/Loader/YamlFileLoaderTest.php b/src/Symfony/Component/DependencyInjection/Tests/Loader/YamlFileLoaderTest.php index 54900e4c3e146..473e550303ae5 100644 --- a/src/Symfony/Component/DependencyInjection/Tests/Loader/YamlFileLoaderTest.php +++ b/src/Symfony/Component/DependencyInjection/Tests/Loader/YamlFileLoaderTest.php @@ -1211,17 +1211,4 @@ public function testStaticConstructor() $definition = $container->getDefinition('static_constructor'); $this->assertEquals((new Definition('stdClass'))->setFactory([null, 'create']), $definition); } - - /** - * @group legacy - */ - public function testDeprecatedTagged() - { - $container = new ContainerBuilder(); - $loader = new YamlFileLoader($container, new FileLocator(self::$fixturesPath.'/yaml')); - - $this->expectUserDeprecationMessage(\sprintf('Since symfony/dependency-injection 7.2: Using "!tagged" is deprecated, use "!tagged_iterator" instead in "%s/yaml%stagged_deprecated.yml".', self::$fixturesPath, \DIRECTORY_SEPARATOR)); - - $loader->load('tagged_deprecated.yml'); - } } 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