-
-
Notifications
You must be signed in to change notification settings - Fork 9.8k
Closed
Description
Symfony version(s) affected
6.1.0
Description
When using the new AbstractBundle introduced in Symfony 6.1, the path of the bundle is that of the parent directory which doesn't make any sense to me.
How to reproduce
- Create
src/Shared/Infrastructure/GraphQLdirectory - Create
GraphQLBundle.phpfile in that directory that implementsAbstractBundle - Try to import routes using
@GraphQLBundle/Controller/and see that it fails
This is because the bundle is registered like this in the Kernel:
"GraphQLBundle" => Shared\Infrastructure\GraphQL\GraphQLBundle^ {#142
#name: "GraphQLBundle"
#extension: Symfony\Component\HttpKernel\Bundle\BundleExtension^ {#6812
-processedConfigs: []
-subject: Shared\Infrastructure\GraphQL\GraphQLBundle^ {#142}
-alias: "graphql"
}
#path: "/Volumes/CS/www/website/src/Shared/Infrastructure"
-namespace: "Shared\Infrastructure\GraphQL"
#container: null
#extensionAlias: "graphql"
}
As you can see, the path property of the bundle is the parent directory src/Shared/Infrastructure
Possible Solution
I think the solution merged in #46385 needs thought.
For now, I need to manually override the path property to fix this. But shouldn't the bundle's path always be the location that specifies the bundle file?