Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 1a4f8ff

Browse filesBrowse files
greg0irejaviereguiluz
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
Copy full SHA for 1a4f8ff

File tree

1 file changed

+8
-0
lines changed
Filter options

1 file changed

+8
-0
lines changed

‎service_container/autowiring.rst

Copy file name to clipboardExpand all lines: service_container/autowiring.rst
+8Lines 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)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.