-
-
Notifications
You must be signed in to change notification settings - Fork 947
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 return statements in Commands/GeneratorCommand.php #1026
Conversation
Hello & thank you for the contribution. Could you also add return type hints in this case then? Thanks |
Hi @nWidart , added return type hint as requested. |
Sorry I meant the pho 7 type hint |
@nWidart It seems adding a return type hint of |
Hm yea that's the cost of this change. I'm not sure if this is worth it, as this is the first time this request has been made. |
I was trying to make a custom command (which extends the GeneratorCommand class of laravel-modules) which is similar to Laravel's |
Hm, I see that's indeed useful. |
If I may suggest, let's use error codes instead where
|
I like that idea about return codes a lot @rcbgalido ! Indeed we will be able to test for it. |
@nWidart Great! Will try to implement it then. |
Here are the new updates:
|
Thanks! This is looking really good, very helpful! 💯 Interesting that |
No problem! For |
These return statements are useful when a subclass of the GeneratorCommand class wants to execute the
handle()
of its parent class but wants to know if the file creation was successful or not.