Thanks to visit codestin.com
Credit goes to github.com

Skip to content

[Console] Ensure overriding Command::execute() keeps priority over __invoke() #60361

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

Merged
merged 1 commit into from
May 6, 2025

Conversation

GromNaN
Copy link
Member

@GromNaN GromNaN commented May 6, 2025

Q A
Branch? 7.3
Bug fix? yes
New feature? no
Deprecations? no
Issues Replace #60353
License MIT

Implements #60353 (comment)

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.

Thanks Jérôme!

@chalasr
Copy link
Member

chalasr commented May 6, 2025

Thank you @GromNaN.

@chalasr chalasr merged commit ed0a235 into symfony:7.3 May 6, 2025
9 of 11 checks passed
@GromNaN GromNaN deleted the command-exec branch May 6, 2025 14:09
};

$command->run(new ArrayInput([]), new NullOutput());
$this->assertSame('execute', $command->called);
Copy link
Contributor

Choose a reason for hiding this comment

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

This tests only if it was called, but in theory the other method could be called before

Copy link
Member Author

Choose a reason for hiding this comment

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

Only it was the last called. I assumed that was enough to cover the feature.

Copy link
Contributor

Choose a reason for hiding this comment

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

But priority means it should be the first called method, right?

Copy link
Member

Choose a reason for hiding this comment

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

In practice, only one of them can be called by Command::run()

@fabpot fabpot mentioned this pull request May 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants