-
-
Notifications
You must be signed in to change notification settings - Fork 424
Ability to use sub namespace for entity #94
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Some context: someone suggested this in the Symfony Slack. I told him that I was going to think about this. I was going to submit an issue so we could discuss it, instead of sending a pull request. We always prefer issues over pull requests. Why an issue? First to see if we approve or reject this feature. Second, to design it to work as greatly as we can. For example:
As you can see, even a small feature needs a lot of thinking to do it great. That's why I always prefer issues over pull requests. But let's not close this PR now that you have created. Let's just stop working on it until the feature is approved. Thanks. |
Thanks for your time and explanations ! I'm more than agree with all the remarks. Well, and i guess the namespace subject apply to almost all makers :) |
I think I'm +1 for this, as it doesn't add complexity for the user. Actually, it removes some complexity. Most users will just enter Anyways, if the user wants to type a sub-namespace, I suppose it's fine. Of course, it's kind of annoying, because they'll need the double |
RLY ? |
Validator::validateClassName($entityClassName); | ||
$entityAlias = strtolower($entityClassName[0]); | ||
$repositoryClassName = Str::addSuffix($entityClassName, 'Repository'); | ||
|
||
return [ | ||
'path' => $path, | ||
'entity_namespace' => $namespace, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could we make this be the full namespace - e.g. App\Entity\Foo
or App\Entity
? It would drastically simplify the template. We should also have one for repository_namespace
|
||
if ($namespace) { | ||
$path = $path.'/' ; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should somehow be extracted into an external class, as we'll probably want to re-use this other places too.
I'm rooting for this to be added ASAP, manually moving files around is a lot of added workload |
It’s high on my list - I’ll finish the updated make:entity this week. Then we should add this ability to all maker commands :) |
@weaverryan you're the best 😁 |
I don't get what i'm missing with the coding convention ...if someone can explain me ...