Closed
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.