Skip to content

Commit 1073e98

Browse files
feature #40468 Deprecate configuring tag names and service ids in compiler passes (nicolas-grekas)
This PR was merged into the 5.3-dev branch. Discussion ---------- Deprecate configuring tag names and service ids in compiler passes | Q | A | ------------- | --- | Branch? | 5.x | Bug fix? | no | New feature? | no | Deprecations? | yes | Tickets | - | License | MIT | Doc PR | - This PR is aimed at reducing the code complexity by hardcoding the name of tags and service ids that compiler passes have to deal with. I think making these names configurable only adds boilerplate and maintenance overhead for no benefit: - for the practice: the need to use a pass with a renamed tag/id should be extremely rare (do yo know any?) - for the theory: a decorating pass could still rename before/after the processing, so this use case is still supported. Side note: I skipped updating changelog+upgrade files. This would be just noise to me (nobody uses this possibility anyway ;) ) Commits ------- 6fe82d8be7 Deprecate configuring tag names and service ids in compiler passes
2 parents f9146c5 + a680961 commit 1073e98

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

DependencyInjection/Compiler/TestServiceContainerWeakRefPass.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,10 @@ class TestServiceContainerWeakRefPass implements CompilerPassInterface
2626

2727
public function __construct(string $privateTagName = 'container.private')
2828
{
29+
if (0 < \func_num_args()) {
30+
trigger_deprecation('symfony/framework-bundle', '5.3', 'Configuring "%s" is deprecated.', __CLASS__);
31+
}
32+
2933
$this->privateTagName = $privateTagName;
3034
}
3135

0 commit comments

Comments
 (0)