maker-bundle
maker-bundle copied to clipboard
Configuration for custom namespaces
Hi there,
I'm working on projects which have the convention to put all the entities and repositories under App\Database\Entity and App\Database\Repository.
I've had a quick look at the issues and the PRs and I've seen other people asking for the same thing so I've decided to give it a go :)
Here is a simple solution to implement a helper to hold all the different namespaces, give it to the generator so it can be used in all makers.
This solution changes the constructor signatures of:
Symfony\Bundle\MakerBundle\GeneratorSymfony\Bundle\MakerBundle\Doctrine\DoctrineHelper
Those objects are used with DI so it doesn't impact the existing makers but if anyone has extended them in their project it would then be a BC.
I leave this PR here and I'm looking forward to hearing from you.
Hey Nate!
Iโll do my best to review soon - I have a few other things to take care of in the short-term. But my first impression is that... this looks pretty sweet! It doesnโt cause any extra headache for users with the default setup and gives nice flexibility. Great idea!
Cheers!
Thank you for the answer, I'm glad of this positive feedback :)
Please let me know if there is anything I can do.
Will probably fix #363 and #368
@weaverryan Sorry I've just seen your comments it was a long weekend here in Australia so I've taken some time off the computer :) I will update the code according to your comments shortly. Thanks for the feedback.
@weaverryan Did you have a chance to have a look at the changes? And also the builds are failing because of the Translation component not being installed, did I do anything wrong? Thank you
Why not load the namespace from the composer file similar to how laravel does it in the getNamespace function?
https://github.com/laravel/framework/blob/6.x/src/Illuminate/Foundation/Application.php
@weaverryan Sorry for the delay I've been distracted on other projects ๐
I've tried to apply everything you've said in your comments.
What is needed to get this merged as this feature would make the MakerBundle much more usable in non-standard Installations (e.G. DDD coneptualized Applications).
@Blackskyliner maybe you also want to comment at https://github.com/symfony/maker-bundle/issues/368
@Blackskyliner @c33s thank you for your interest in this PR ๐ TBH the work was done so long ago I'm actually not sure, I believe I've implemented the feedback I was given and was waiting for another review. Now the code has changed quite a bit since, so I can see conflicts that would need to be addressed, but I think that's it
@natepage - if you can get this rebased to resolve the conflicts with passing tests, ill get another review on this pretty quick so we can merge. Thanks in advanced!
@jrushlow I've rebased the PR to the latest main, however I have this issue with setting up the database for tests
Exception: Could not find "***127.0.0.1:5432/app?serverVersion=13&charset=utf8" inside ".env"
Could you please guide me a little bit on how to resolve this?
Howdy @natepage - the issue was with our CI and i've just merged a fix for this in #1179. If you rebase, the testsuite should run correctly. There may be a few unrelated failures, but nothing to worry about. I'm whipping up a fix for those in #1180 now. Thanks for the work on this!
Hey @jrushlow, sorry for the late reply I got caught up with life.. ๐ I've synced my PR and most CI is green excepted some tests around CRUD generation with PHP8.1 and Syfmony 6.2, I've tried to have a quick look at it but I didn't have enough time to fully understand how the tests are running. Do you think it's related to my changes?
I would love to have this feature for our Symfony bundle! @natepage, can you rebase your PR to main and see if the errors are still there?
@cavasinf sorry for the late reply, I've synced my PR with main, fixed conflicts and addressed coding standards.
However, some tests are failing because it looks like the ExpressionLanguage isn't getting installed with the given dependencies config.
Not too sure what to do with this ๐
Hello everyone, what is missing? Is there anything I can help with?