foundry
foundry copied to clipboard
Default namespace adding a App\ as a prefix
I want to use Foundry in my project to generate fixtures. I've configured the zenstruck_foundry.yaml as the following :
zenstruck_foundry:
make_factory:
# Default namespace where factories will be created by maker.
default_namespace: \Tcs\Service\ServiceName\Factory
but when I do a bin/console make:factory, and choosing the entity I need, I have this error :
Could not determine where to locate the new class "App\Tcs\Service\ServiceName\Factory\DeviceFactory", maybe try with a full namespace like "\My\Full\Namespace\DeviceFactory"
Hey,
I've tried to reproduce in a project which does not use App as main namespace, and I got this warning:
➜ bin/console make:factory --namespace MyVendor\\Factory
! [NOTE] It looks like your app may be using a namespace other than "App".
!
! To configure this and make your life easier, see: https://symfony.com/doc/current/bundles/SymfonyMakerBundle/index.html#configuration
The links suggests to add some config for maker bundle:
maker:
root_namespace: 'MyVendor'
I think it is super explicit, so this won't need any change in Foundry. Or maybe there is a bug where it didn't not show up?
I'm closing this stale issue