maker-bundle icon indicating copy to clipboard operation
maker-bundle copied to clipboard

Configuration for custom namespaces

Open natepage opened this issue 6 years ago โ€ข 19 comments

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\Generator
  • Symfony\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.

natepage avatar Apr 07 '19 12:04 natepage

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!

weaverryan avatar Apr 09 '19 00:04 weaverryan

Thank you for the answer, I'm glad of this positive feedback :)

Please let me know if there is anything I can do.

natepage avatar Apr 10 '19 10:04 natepage

Will probably fix #363 and #368

jschaedl avatar Apr 21 '19 13:04 jschaedl

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

natepage avatar Apr 23 '19 00:04 natepage

@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

natepage avatar May 02 '19 12:05 natepage

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

xaoseric avatar Dec 05 '19 14:12 xaoseric

@weaverryan Sorry for the delay I've been distracted on other projects ๐Ÿ˜„

I've tried to apply everything you've said in your comments.

natepage avatar Jan 07 '20 11:01 natepage

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 avatar Aug 23 '22 08:08 Blackskyliner

@Blackskyliner maybe you also want to comment at https://github.com/symfony/maker-bundle/issues/368

c33s avatar Aug 23 '22 12:08 c33s

@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 avatar Aug 23 '22 22:08 natepage

@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 avatar Aug 23 '22 22:08 jrushlow

@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?

natepage avatar Aug 30 '22 15:08 natepage

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!

jrushlow avatar Sep 13 '22 13:09 jrushlow

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?

natepage avatar Oct 20 '22 12:10 natepage

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 avatar Sep 12 '23 12:09 cavasinf

@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 ๐Ÿ˜„

natepage avatar Oct 02 '23 05:10 natepage

Hello everyone, what is missing? Is there anything I can help with?

richardrodriguez21 avatar Feb 24 '24 15:02 richardrodriguez21