-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[Process] (Unwanted?) BC break with strict typing #28609
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
Comments
BTW, you are still casting to string here to check empty arguments: symfony/src/Symfony/Component/Process/Process.php Lines 1575 to 1577 in 3cd411a
But this is now not efficient with the strict typing, confirming a bug to me. |
Well, I'm wondering whether |
@stof I don't know, but it was. BTW the current string casting inside the method seems to show us it is. |
…udaltsov) This PR was merged into the 4.1 branch. Discussion ---------- [Process] Allow to pass non-string arguments to Process | Q | A | ------------- | --- | Branch? | 4.1 | Bug fix? | yes | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | #28609 | License | MIT | Doc PR | Sometimes you might pass integers, floats, nulls as command arguments to the Process constructor. Before 4.0 and #24722 that worked fine. Now it throws because of an invalid type. I think we can drop the type hint here safely and stringify the value implicitly in the method. That will be a little more convenient. Commits ------- acf8b83 Remove Process::escapeArgument argument type hint
Symfony version(s) affected: 4.1.4
Description
If you create a process with an array command-line containing null variable, it will fail:
How to reproduce
Possible Solution
I know it's a new major, but I found nothing about this issue on the upgrade guide. Plus, the error is not very explicit.
Two possibility:
escapeArgument
to have the same behavior as Symfony 3.The text was updated successfully, but these errors were encountered: