Skip to content
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

[Console] Remove invalid ProcessHelper specified usage #20683

Merged

Conversation

viviengaetan
Copy link
Contributor

Since Symfony 6.0, the ProcessHelper have the $cmd argument from its two methods run() and mustRun() typed as array|Process source.

When you try to run as described in the documentation with a string, PHP will throw a TypeError

Fatal error: Uncaught TypeError: Symfony\Component\Console\Helper\ProcessHelper::run(): Argument #2 ($cmd) must be of type Symfony\Component\Process\Process|array, string given, called in /app/src/FooCommand.php on line 22 and defined in /app/vendor/symfony/console/Helper/ProcessHelper.php:35

Documentation is invalid since 6.0 up to the latest version.

@javiereguiluz
Copy link
Member

Good catch Gaëtan! Thanks and congrats on your first Symfony Docs contribution 🎉

@javiereguiluz javiereguiluz merged commit f036ebf into symfony:6.4 Feb 24, 2025
3 checks passed
@viviengaetan viviengaetan deleted the fix/console_process_helper_usage branch February 25, 2025 17:22
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.

4 participants