Skip to content

Commit 840aa55

Browse files
committed
minor #21617 [DependencyInjection] #[AutoconfigureTag] can be used without tag name (HypeMC)
This PR was merged into the 6.4 branch. Discussion ---------- [DependencyInjection] `#[AutoconfigureTag]` can be used without tag name This was never documented, but when the tag name in `#[AutoconfigureTag]` is not specified, the fully qualified class name of the target is automatically used. Commits ------- 0709b35 [DependencyInjection] `#[AutoconfigureTag]` can be used without tag name
2 parents de070b6 + 0709b35 commit 840aa55

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

service_container/tags.rst

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,16 @@ base class or interface::
131131
// ...
132132
}
133133

134+
When no tag name is specified, the fully qualified class name (FQCN) of the target is used::
135+
136+
// src/Security/CustomInterface.php
137+
138+
#[AutoconfigureTag] // equivalent to #[AutoconfigureTag(self::class)]
139+
interface CustomInterface
140+
{
141+
// ...
142+
}
143+
134144
.. tip::
135145

136146
If you need more capabilities to autoconfigure instances of your base class

0 commit comments

Comments
 (0)