Use invokable commands for Symfony 7.4#290
Merged
OskarStark merged 4 commits intomasterfrom Dec 4, 2025
Merged
Conversation
Convert all console commands to use the new invokable command pattern introduced in Symfony 7.3, removing the need to extend Command class and using __invoke method with attribute-based argument/option definition.
Use Symfony\Component\Console\Attribute\Option and Argument instead of the Input\InputOption and Input\InputArgument classes.
OskarStark
commented
Dec 3, 2025
yceruto
reviewed
Dec 3, 2025
Member
yceruto
left a comment
There was a problem hiding this comment.
Thank you for handling this, Oskar.
| #[Option(description: 'A string representing a time period to for how long the issue has been stalled.')] | ||
| string $notUpdatedFor = '12months', | ||
| #[Option(description: 'Do a test search without making any comments or changes')] | ||
| bool $dryRun = false, |
Member
There was a problem hiding this comment.
from my view, creating a #[MapInput] PingStaleIssuesInput $input would improve readability here, but it's fine if you prefer keeping the flat structure
yceruto
approved these changes
Dec 4, 2025
chalasr
approved these changes
Dec 4, 2025
Contributor
chalasr
left a comment
There was a problem hiding this comment.
Out of curosity, did you use Rector?
Contributor
Author
|
Nope, but I know rector can handle it. If we are ok with adding rector as a depenendcy + config, I am open to bring it in |
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
No description provided.