Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork9.7k
[2.3][Process] Add validation on Process input#10929
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
romainneutron commentedMay 17, 2014
Deprecation is proposed in PR#10930 |
stof commentedMay 17, 2014
The phpdoc documents the type of the argument as |
romainneutron commentedMay 17, 2014
That's why I added a check. Passing a stream with the current implementation results in an error |
stof commentedMay 17, 2014
@romainneutron I would just cast the value as string when it is not |
romainneutron commentedMay 17, 2014
ok, let's cast scalars, throw exceptions for others type? Seehttp://3v4l.org/6HTo5 |
stof commentedMay 17, 2014
arf, I forgot resources are castable as string. So yeah, this case need to be validated |
stof commentedMay 17, 2014
btw, the PHP 4.3.3+ error message is funny in your snippet: |
romainneutron commentedMay 17, 2014
PR updated. |
fabpot commentedMay 22, 2014
Thank you@romainneutron. |
…ron)This PR was merged into the 2.3 branch.Discussion----------[2.3][Process] Add validation on Process input| Q | A| ------------- | ---| Bug fix? | yes| New feature? | no| BC breaks? | no| Deprecations? | no| Tests pass? | yes| Fixed tickets | n/a| License | MITThis adds validation on Process input. For the moment, passing a stream would result in a PHP error.I propose to deprecate values that are not strictly string in 2.6 (see upcoming PR)Commits-------583092b [Process] Add validation on Process input
…or Process::setStdin and ProcessBuilder::setInput (romainneutron)This PR was merged into the 2.4-dev branch.Discussion----------[Process] Deprecate using values that are not string for Process::setStdin and ProcessBuilder::setInput| Q | A| ------------- | ---| Bug fix? | no| New feature? | no| BC breaks? | no| Deprecations? | yes| Tests pass? | yes| Fixed tickets | n/a| License | MITThis deprecates passing a `Process` input any value that is not a strict string. This needs#10929 to be merged.I don't know if the use of `trigger_error` is correct or should be removed.Commits-------9887b83 [Process] Deprecate using values that are not string for Process::setStdin and ProcessBuilder::setInput
This adds validation on Process input. For the moment, passing a stream would result in a PHP error.
I propose to deprecate values that are not strictly string in 2.6 (see upcoming PR)