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

Skip to content

[Console] Make $input argument for CommandTester optional #60873

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

Closed
wants to merge 1 commit into from

Conversation

ruudk
Copy link
Contributor

@ruudk ruudk commented Jun 23, 2025

Q A
Branch? 7.4
Bug fix? no
New feature? yes
Deprecations? no
Issues
License MIT

Why require an input to be passed when none is needed?

new CommandTester($command)->execute([]);

It would look better if I could do:

new CommandTester($command)->execute();

Why require an input to be passed when none is needed?
@nicolas-grekas
Copy link
Member

nicolas-grekas commented Jun 23, 2025

But that's a BC break 😬

@stof
Copy link
Member

stof commented Jun 23, 2025

@ruudk
Copy link
Contributor Author

ruudk commented Jun 23, 2025

😢 So this cannot be done then?

@nicolas-grekas
Copy link
Member

nicolas-grekas commented Jun 23, 2025

We'd need to make the class final, but that could only be done if there are alternatives to inheritance, which I'm not sure of. Then it could be done only in Symfony 8. But that might be a bit too heavy for the community, just to save two chars...

@ruudk
Copy link
Contributor Author

ruudk commented Jun 23, 2025

Ok, thanks for the explanation. Let's close it.

@ruudk ruudk closed this Jun 23, 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.

5 participants