Skip to content

Commit

Permalink
minor #20683 [Console] Remove invalid ProcessHelper specified usage (…
Browse files Browse the repository at this point in the history
…viviengaetan)

This PR was merged into the 6.4 branch.

Discussion
----------

[Console] Remove invalid ProcessHelper specified usage

Since Symfony 6.0, the ProcessHelper have the `$cmd` argument from its two methods `run()` and `mustRun()` typed as `array|Process` [source](https://github.com/symfony/symfony/blob/6.0/src/Symfony/Component/Console/Helper/ProcessHelper.php).

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.

Commits
-------

4f64107 [Console] Remove invalid ProcessHelper specified usage
  • Loading branch information
javiereguiluz committed Feb 24, 2025
2 parents 104e43c + 4f64107 commit f036ebf
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions components/console/helpers/processhelper.rst
Original file line number Diff line number Diff line change
Expand Up @@ -42,12 +42,7 @@ In case the process fails, debugging is easier:
Arguments
---------

There are three ways to use the process helper:

* Using a command line string::

// ...
$helper->run($output, 'figlet Symfony');
There are two ways to use the process helper:

* An array of arguments::

Expand Down

0 comments on commit f036ebf

Please sign in to comment.