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

[Process] PhpProcess constructor arguments #35637

Closed
Guikingone opened this issue Feb 7, 2020 · 0 comments · Fixed by #35641
Closed

[Process] PhpProcess constructor arguments #35637

Guikingone opened this issue Feb 7, 2020 · 0 comments · Fixed by #35641

Comments

@Guikingone
Copy link
Contributor

Guikingone commented Feb 7, 2020

Symfony version(s) affected: master

Description
Using the PhpProcess::fromShellCommandline() method and passing a simple string echo Symfony, it seems that PhpProcess constructor requires a string, by default, the fromShellCommandline implementation depends on the Process one which requires an array as the first argument.

How to reproduce
Just try to instantiante PhpProcess::fromShellCommandline() with a string echo Symfony.

Possible Solution

#35641

Additional context
As far as I can see, it seems that the error occurs here:

$process = new static([], $cwd, $env, $input, $timeout);
$process->commandline = $command;

return $process;

PhpProcess receive an array as the first argument 🤔

@fabpot fabpot closed this as completed Feb 8, 2020
fabpot added a commit that referenced this issue Feb 8, 2020
… used (Guikingone)

This PR was merged into the 4.4 branch.

Discussion
----------

[Process] throw when PhpProcess::fromShellCommandLine() is used

| Q             | A
| ------------- | ---
| Branch?       | 4.4
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Tickets       | Fix #35637
| License       | MIT
| Doc PR        | None

Close #35638

Final PR (rebased and tests added)

Commits
-------

7f6d71c refactor(Process): fromShellCommandLine
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants