Description
Description
The bundle class has a getPath()
method, allowing you to override the path of the bundle. However, inside the FrameworkExtension, $reflection->getFileName()
is used to get the path to the bundle. This means that getPath()
is ignored.
Use-case
In my case, my bundle directory structure looks like:
MyBundle/
src/
MyBundle.php
...
Resources/
config/
serializer.yml
validator.yml
In the MyBundle
class, I override getPath()
to return MyBundle/
. This way, I would expect the serializer and validator configuration to be loaded. However, since they use reflection they're looking for MyBundle/src/Resources/config/serializer.yml
.
Possible Solution
The auto-discovery of config files should be moved to a compiler pass. These have access to the bundle class instance (instead of FQCN) and can call ->getPath()
on this instance instead of simulating the default behaviour of this method.