Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork9.7k
[Process] Allow to pass null arguments to Process#28863
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
nicolas-grekas commentedOct 14, 2018
Should target 3.4 is suppose. Could you please add a test case also? |
vudaltsov commentedOct 14, 2018 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
@nicolas-grekas , typehints were added in 4.0 with php 7.0. In 3.4 everything should work fine (seehttps://github.com/symfony/symfony/blob/3.4/src/Symfony/Component/Process/Process.php#L1714). |
nicolas-grekas commentedOct 14, 2018
OK, so maybe only the test case should target 3.4 then? |
vudaltsov commentedOct 14, 2018
Rebased onto 4.1, since 4.0 is for security fixes only. Ok, I will add another PR with a test case for 3.4 soon. |
vudaltsov commentedOct 14, 2018
@nicolas-grekas , a test case is ready in#28864 |
…nts (vudaltsov)This PR was merged into the 3.4 branch.Discussion----------[Process] A test case for stringifying of Process arguments| Q | A| ------------- | ---| Branch? | 3.4| Bug fix? | no| New feature? | no| BC breaks? | no| Deprecations? | no| Tests pass? | yes| Fixed tickets | for#28863| License | MIT| Doc PR |Checks that non-string arguments passed to Process constructor are typecasted to stringCommits-------0d54342 Add a test case for stringifying of Process arguments
vudaltsov commentedOct 14, 2018
Ready! |
Uh oh!
There was an error while loading.Please reload this page.
vudaltsov commentedOct 14, 2018
@nicolas-grekas , addressed your comment |
nicolas-grekas commentedOct 14, 2018
Thank you@vudaltsov. |
…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
soullivaneuh commentedOct 15, 2018
Thank you@vudaltsov! :-) |
vudaltsov commentedOct 15, 2018
@nicolas-grekas , the point of my PR was to allow to pass ints and floats as well... Why did you remove that? |
vudaltsov commentedOct 15, 2018 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
I have two arguments:
|
nicolas-grekas commentedOct 15, 2018
I didn't remove that: this is PHP language, where types are cast automatically for you when needed. |
vudaltsov commentedOct 15, 2018
Am I right that this is because we don't have |
nicolas-grekas commentedOct 15, 2018
That's correct. |
Uh oh!
There was an error while loading.Please reload this page.
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.