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
add make:enum command #12
Conversation
Hi @Gummibeer Looking good already! I'll review this in more depth later this week (hopefully today) |
@brendt poke 🤛 |
hi Tom 👋😁 I'll do my best to check this out this week! Sorry for the delay, lots of project work going on and some personal stuff also. |
public function it_can_make_an_enum_with_methods_studly(): void | ||
{ | ||
$values = [ | ||
'Monday' => 'monday', |
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.
How would this command be invoked in real situations? Wouldn't it be quite a hassle to write all values on the commandline?
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.
I would say that it's something like the make commands for models, migrations and so on. They also have a lot of options to configure the resulting model but most times you simply use make:model Post
and do the rest in the created file itself.
I would keep them in to allow custom extensions like make:enum:by-model
which reads values from DB and puts them in place or whatever.
The other solution would be a JSON file - but I don't think that someone wants to create a JSON file to call a make command?
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.
Good enough. I do think we need to be a little careful not to "overbloat" this package from the start. It's easy to add new features, but it's a lot harder to maintain remove them afterwards.
But I do think this make command is a valuable one to have, so let's go ahead and merge it 👍
@brendt no problem and don't stress yourself! Just wanted to bring up this PR again to "finish" the work for a v1.0.0 release. :) |
@Gummibeer feel free to merge this one! |
…mand # Conflicts: # tests/TestCase.php
No description provided.