-
-
Notifications
You must be signed in to change notification settings - Fork 5.2k
Closed
Labels
DependencyInjectionbughasPRA Pull Request has already been submitted for this issue.A Pull Request has already been submitted for this issue.
Milestone
Description
So far, if we're using the PSR4 loader in a YAML or XML code block, in PHP, we say something like "this is not possible". For example: the configuration-block
under https://github.com/symfony/symfony-docs/blob/80138cacba5604398aafb54c3cde1117529d6817/service_container.rst#creatingconfiguring-services-in-the-container.
But actually, @nicolas-grekas pointed out that this is not correct! In a PHP file, I believe the $this
variable should be an instance of the PhpFileLoader
. So we should be able to do:
$definition = new Definition();
$this->registerClasses($definition, 'AppBundle\\', '../../src/AppBundle/*', '../../src/AppBundle/{Entity,Repository}');
Let's update all the examples with this on the 3.3 branch.
Metadata
Metadata
Assignees
Labels
DependencyInjectionbughasPRA Pull Request has already been submitted for this issue.A Pull Request has already been submitted for this issue.