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 #54371 [DependencyInjection] Deprecate #[TaggedIterator] and #[TaggedLocator] (GromNaN)
This PR was merged into the 7.1 branch.
Discussion
----------
[DependencyInjection] Deprecate `#[TaggedIterator]` and `#[TaggedLocator]`
| Q | A
| ------------- | ---
| Branch? | 7.1
| Bug fix? | no
| New feature? | no
| Deprecations? | yes
| Issues | Planned in #51832
| License | MIT
`#[TaggedIterator]` and `#[TaggedLocator]` attributes are replaced by `#[AutowireIterator]` and `#[AutowireLocator]`, for naming consistency with all `#[Autowire*]` attributes.
Commits
-------
4bc6bed Deprecate #[TaggedIterator] and #[TaggedLocator]
Copy file name to clipboardExpand all lines: UPGRADE-7.1.md
+1
Original file line number
Diff line number
Diff line change
@@ -47,6 +47,7 @@ DependencyInjection
47
47
-------------------
48
48
49
49
*[BC BREAK] When used in the `prependExtension()` method, the `ContainerConfigurator::import()` method now prepends the configuration instead of appending it
50
+
* Deprecate `#[TaggedIterator]` and `#[TaggedLocator]` attributes, use `#[AutowireIterator]` and `#[AutowireLocator]` instead
Copy file name to clipboardExpand all lines: src/Symfony/Component/DependencyInjection/Attribute/TaggedIterator.php
+4
Original file line number
Diff line number
Diff line change
@@ -13,6 +13,8 @@
13
13
14
14
/**
15
15
* Autowires an iterator of services based on a tag name.
16
+
*
17
+
* @deprecated since Symfony 7.1, use {@see AutowireIterator} instead.
16
18
*/
17
19
#[\Attribute(\Attribute::TARGET_PARAMETER)]
18
20
class TaggedIterator extends AutowireIterator
@@ -33,6 +35,8 @@ public function __construct(
33
35
publicstring|array$exclude = [],
34
36
publicbool$excludeSelf = true,
35
37
) {
38
+
trigger_deprecation('symfony/dependency-injection', '7.1', 'The "%s" attribute is deprecated, use "%s" instead.', self::class, AutowireIterator::class);
Copy file name to clipboardExpand all lines: src/Symfony/Component/DependencyInjection/Attribute/TaggedLocator.php
+4
Original file line number
Diff line number
Diff line change
@@ -13,6 +13,8 @@
13
13
14
14
/**
15
15
* Autowires a locator of services based on a tag name.
16
+
*
17
+
* @deprecated since Symfony 7.1, use {@see AutowireLocator} instead.
16
18
*/
17
19
#[\Attribute(\Attribute::TARGET_PARAMETER)]
18
20
class TaggedLocator extends AutowireLocator
@@ -33,6 +35,8 @@ public function __construct(
33
35
publicstring|array$exclude = [],
34
36
publicbool$excludeSelf = true,
35
37
) {
38
+
trigger_deprecation('symfony/dependency-injection', '7.1', 'The "%s" attribute is deprecated, use "%s" instead.', self::class, AutowireLocator::class);
Copy file name to clipboardExpand all lines: src/Symfony/Component/DependencyInjection/Tests/Fixtures/TaggedIteratorConsumerWithDefaultIndexMethodAndWithDefaultPriorityMethod.php
Copy file name to clipboardExpand all lines: src/Symfony/Component/DependencyInjection/Tests/Fixtures/TaggedIteratorConsumerWithDefaultPriorityMethod.php
Copy file name to clipboardExpand all lines: src/Symfony/Component/DependencyInjection/Tests/Fixtures/TaggedLocatorConsumerWithDefaultIndexMethodAndWithDefaultPriorityMethod.php
Copy file name to clipboardExpand all lines: src/Symfony/Component/DependencyInjection/Tests/Fixtures/TaggedLocatorConsumerWithDefaultPriorityMethod.php
0 commit comments