Skip to content

Commit 852e046

Browse files
committed
feature #17960 [DependencyInjection] Add #[Exclude] attribute (alexandre-daubois)
This PR was merged into the 6.3 branch. Discussion ---------- [DependencyInjection] Add `#[Exclude]` attribute Fixes #17959 Commits ------- ea945b0 [DependencyInjection] Add `#[Exclude]` attribute
2 parents ad55b0d + ea945b0 commit 852e046

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

service_container.rst

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1074,7 +1074,14 @@ key. For example, the default Symfony configuration contains this:
10741074
.. tip::
10751075

10761076
The value of the ``resource`` and ``exclude`` options can be any valid
1077-
`glob pattern`_.
1077+
`glob pattern`_. If you want to exclude only a few services, you
1078+
may use the :class:`Symfony\\Component\\Dependency\Injection\\Attribute\\Exclude`
1079+
attribute directly on your class to exclude it.
1080+
1081+
.. versionadded:: 6.3
1082+
1083+
The :class:`Symfony\\Component\\Dependency\Injection\\Attribute\\Exclude`
1084+
attribute was introduced in Symfony 6.3.
10781085

10791086
This can be used to quickly make many classes available as services and apply some
10801087
default configuration. The ``id`` of each service is its fully-qualified class name.

0 commit comments

Comments
 (0)