-
-
Notifications
You must be signed in to change notification settings - Fork 437
Add --no-template option for make:controller command #280
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 --no-template option for make:controller command #280
Conversation
src/Maker/MakeController.php
Outdated
| $command | ||
| ->setDescription('Creates a new controller class') | ||
| ->addArgument('controller-class', InputArgument::OPTIONAL, sprintf('Choose a name for your controller class (e.g. <fg=yellow>%sController</>)', Str::asClassName(Str::getRandomTerm()))) | ||
| ->addOption('--no-template', '-n', InputOption::VALUE_OPTIONAL) |
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 think you mean InputOption::VALUE_NONE
|
Hey @welcoMattic! In general, I want to be careful about adding customizations like this. But, this one seems reasonable. It looks like some of the existing controller tests broke. Can you check those out? I'm not sure what's going on - I'd try to run those test cases locally if you can. Cheers! |
|
Yes, existing tests broke. It seems to be because of If you can run those tests locally to help, that would be nice 😉 Thanks |
|
Hey! Would you mind running the tests locally? I’m happy to review or debug (especially if the test suite doesn’t has any issues running on your machine), but I’d prefer you to finish this feature if you’d like it :) |
|
Hi @weaverryan! I just ran tests locally with Output
If I well understand, PHPUnit runs another PHPUnit to test generated code? I guess failure is in this sub-PHPUnit test suite |
|
Tests are green 🎉 The error was my shortcut of Feel free to merge if it is ok for you. |
|
Sorry for the delay, but this was an excellent PR - very clean. Thank you @welcoMattic! |
…lcoMattic) This PR was squashed before being merged into the 1.0-dev branch (closes #280). Discussion ---------- Add --no-template option for make:controller command I had several times the case in which I did not necessarily need a template when I generated a controller. So I'm trying to add an option `--no-template` to force avoid template generation. I think that I will need help on tests writing ;) Commits ------- 99680bc Fix tests (passed on local env) d6ec857 Fix internal project tests 052734c Try to fix tests 860d340 WIP Add --no-template option for make:controller command
|
No worries @weaverryan! Thank you for the merge! |
I had several times the case in which I did not necessarily need a template when I generated a controller. So I'm trying to add an option
--no-templateto force avoid template generation.I think that I will need help on tests writing ;)