Skip to content

Use invokable commands for Symfony 7.4#290

Merged
OskarStark merged 4 commits intomasterfrom
invokable-commands
Dec 4, 2025
Merged

Use invokable commands for Symfony 7.4#290
OskarStark merged 4 commits intomasterfrom
invokable-commands

Conversation

@OskarStark
Copy link
Contributor

No description provided.

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.
@OskarStark OskarStark requested a review from stof December 3, 2025 05:59
Use Symfony\Component\Console\Attribute\Option and Argument instead
of the Input\InputOption and Input\InputArgument classes.
Copy link
Member

@yceruto yceruto left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

from my view, creating a #[MapInput] PingStaleIssuesInput $input would improve readability here, but it's fine if you prefer keeping the flat structure

@OskarStark OskarStark requested a review from yceruto December 4, 2025 14:31
Copy link
Contributor

@chalasr chalasr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Out of curosity, did you use Rector?

@OskarStark
Copy link
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

@OskarStark OskarStark merged commit 5b28c62 into master Dec 4, 2025
4 checks passed
@OskarStark OskarStark deleted the invokable-commands branch December 4, 2025 18:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants