-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[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 our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Deprecation is proposed in PR #10930 |
The phpdoc documents the type of the argument as |
That's why I added a check. Passing a stream with the current implementation results in an error |
@romainneutron I would just cast the value as string when it is not |
ok, let's cast scalars, throw exceptions for others type? See http://3v4l.org/6HTo5 |
arf, I forgot resources are castable as string. So yeah, this case need to be validated |
btw, the PHP 4.3.3+ error message is funny in your snippet: |
PR updated. |
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 | MIT 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) 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 | MIT This 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)