-
-
Notifications
You must be signed in to change notification settings - Fork 439
[make:command] create invokable command by default #1746
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
Open
seizan8
wants to merge
12
commits into
symfony:1.x
Choose a base branch
from
seizan8:feat/make-command-generate-invokable-by-default
base: 1.x
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 4 commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
22b65f3
feat: updated MakeCommand to create InvokableCommand by default
seizan8 81437a7
style: updated code style to satisfy PHP-CS-Fixer
seizan8 20c0a4b
test: updated MakeCommandTest
seizan8 690fd4d
style: updated code style to satisfy PHP-CS-Fixer
seizan8 ff0b82a
docs: updated commend in MakeCommandTest
seizan8 a131606
refactor: updated method parameters for InvokableCommand
seizan8 d27d248
feat: changed old-structure option to negatable 'invokeable' option
seizan8 50c9802
feat: updated MakeCommand->interact method
seizan8 29084d3
refactor: simplified InvokableCommand template
seizan8 ead2e49
style: updated code style of invokable command template
seizan8 0588d4d
refactor: renamed variable
seizan8 ce19ba3
feat: updated invokable option description for make:command
seizan8 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,32 @@ | ||
| <?= "<?php\n"; ?> | ||
|
|
||
| namespace <?= $namespace; ?>; | ||
|
|
||
| <?= $use_statements; ?> | ||
|
|
||
| #[AsCommand( | ||
| name: '<?= $command_name; ?>', | ||
| description: 'Add a short description for your command', | ||
| )] | ||
| class <?= $class_name; ?> | ||
| { | ||
| public function __invoke( | ||
| SymfonyStyle $symfonyStyle, | ||
| #[Argument('Required argument description')] string $requiredArg, | ||
| #[Argument('Optional nullable argument description')] ?string $optionalNullableArg, | ||
| #[Argument('Optional non-nullable argument description')] int $optionalNonNullableArg = 1, | ||
| #[Option('Option description')] string $option = "defaultOptionValue", | ||
| #[Option('Nullable option description')] ?string $nullableOption = null, | ||
seizan8 marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| ): int | ||
| { | ||
seizan8 marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| $symfonyStyle->note(sprintf('The value of $requiredArg is: %s', $requiredArg)); | ||
| $symfonyStyle->note(sprintf('The value of $optionalNullableArg is: %s', $optionalNullableArg)); | ||
| $symfonyStyle->note(sprintf('The value of $optionalNonNullableArg is: %s', $optionalNonNullableArg)); | ||
| $symfonyStyle->note(sprintf('The value of $option is: %s', $option)); | ||
| $symfonyStyle->note(sprintf('The value of $nullableOption is: %s', $nullableOption)); | ||
|
|
||
| $symfonyStyle->success('You have a new command! Now make it your own! Pass --help to see your options.'); | ||
|
|
||
| return Command::SUCCESS; | ||
| } | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.