-
-
Notifications
You must be signed in to change notification settings - Fork 5.2k
Updates to DI config for 3.3 #7807
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 1 commit
8433fc1
2d11347
105801c
049df7d
9e84572
c45daf4
2636bea
9ab27f0
0e48bd8
6e6ed94
70178d1
45500b3
759e9b2
6de83e2
89e12de
443aec2
bc7088d
ee27765
5452c61
2229fd3
cac3c6c
12c4944
22adfbd
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -142,9 +142,9 @@ the service container *how* to instantiate it: | |
// app/config/services.php | ||
TODO | ||
|
||
That's it! Thanks to the ``AppBundle\`` line and ``resource`` key below it, all | ||
classes in the ``src/AppBundle/Service`` directory (and a few other directories) | ||
will automatically be added to the container. | ||
That's it! Thanks to the ``AppBundle\`` line and ``resource`` key below it, a service | ||
will be registered for each class in the ``src/AppBundle/Service`` directory (and | ||
the other directories listed). | ||
|
||
Each service's "key" is its class name. You can use it immediately inside your controller:: | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
|
||
|
@@ -210,11 +210,11 @@ and set it on a ``$logger`` property:: | |
} | ||
|
||
That's it! The container will *automatically* know to pass the ``logger`` service | ||
when instantiating the ``MessageGenerator``? How does it know to do this? | ||
when instantiating the ``MessageGenerator``. How does it know to do this? | ||
:doc:`Autowiring </service_container/autowiring>`. The key is the ``LoggerInterface`` | ||
type-hint in your ``__construct()`` method and the ``autowire: true`` config in | ||
``services.yml``. When you type-hint an argument, the container will automatically | ||
find the matching service. If it can't or there is any ambuiguity, you'll see a clear | ||
find the matching service. If it can't or there is any ambiguity, you'll see a clear | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. there won't be ambiguities anymore for interfaces (interfaces can be autowired by aliasing only now, when not using the deprecated mode). Dunno how that applies here :) |
||
exception suggesting how to fix it. | ||
|
||
Be sure to read more about :doc:`autowiring </service_container/autowiring>`. | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Prototypes don't exist for php code so imo we should either remove this doc block or let the current one with a comment explaining that it's not possible to register entire folders as with other loaders.