8000 Describe things more precisely · symfony/symfony-docs@1a4f8ff · GitHub
[go: up one dir, main page]

Skip to content

Commit 1a4f8ff

Browse files
greg0irejaviereguiluz 8000
authored andcommitted
Describe things more precisely
Here, namespace is referring to that kind of thing: App\Namespace\: resource: '../../src/App/Namespace/*' And it looks as if there is no word yet to name that kind of configuration block. Let us go with service definition prototype.
1 parent 99a8323 commit 1a4f8ff

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

service_container/autowiring.rst

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -343,6 +343,13 @@ Thanks to the ``AppBundle\Util\TransformerInterface`` alias, the autowiring subs
343343
knows that the ``AppBundle\Util\Rot13Transformer`` service should be injected when
344344
dealing with the ``TransformerInterface``.
345345

346+
.. tip::
347+
348+
When using a `service definition prototype`_, if only one service is
349+
discovered that implements an interface, and that interface is also
350+
discovered at the same time, configuring the alias is not mandatory
351+
and Symfony will automatically create one.
352+
346353
Dealing with Multiple Implementations of the Same Type
347354
------------------------------------------------------
348355

@@ -503,3 +510,4 @@ Public bundles should explicitly configure their services and not rely on autowi
503510

504511
.. _Rapid Application Development: https://en.wikipedia.org/wiki/Rapid_application_development
505512
.. _ROT13: https://en.wikipedia.org/wiki/ROT13
513+
.. _service definition prototype: https://symfony.com/blog/new-in-symfony-3-3-psr-4-based-service-discovery

0 commit comments

Comments
 (0)
0