-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[Process] Add deprecated logs on Process::setInput() and ProcessBuilder::setInput(). #12725
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
Q | A |
---|---|
Bug fix? | no |
New feature? | no |
BC breaks? | no |
Deprecations? | yes |
Tests pass? | yes |
Fixed tickets | #12703 |
License | MIT |
Doc PR |
@@ -1092,6 +1092,7 @@ public function setStdin($stdin) | |||
* Sets the input. | |||
* | |||
* This content will be passed to the underlying process standard input. | |||
* Deprecation: As of Symfony 2.5, this method only accepts scalar values. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you use a @deprecated
annotation instead?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@fabpot Are you sure? Adding a @deprecated
would mean that the entire method is deprecated, at least the IDE will understand it this way. If so I'll have to change it in ProcessBuilder::setInput()
too.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nevermind
…er::setInput() which does not accept non-scalar types.
1c6901b
to
8c5b1de
Compare
@@ -1101,6 +1102,13 @@ public function setStdin($stdin) | |||
*/ | |||
public function setInput($input) | |||
{ | |||
if (!is_scalar($input)) { | |||
trigger_error( | |||
'Passing a non-scalar input is deprecated since version 2.5 and will be removed in 3.0.', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please format it this way:
trigger_error('PropertyAccess::getPropertyAccessor() is deprecated since version 2.3 and will be removed in 3.0. Use PropertyAccess::createPropertyAccessor() instead.', E_USER_DEPRECATED); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@timglabish I thought we have to break lines at 120 char. Are you sure?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, everything on one line.
The deprecation warning should actually be triggered in |
@tmartin Can you update this PR ? |
Closing in favor of #13600 |
This PR was merged into the 2.7 branch. Discussion ---------- [Process] added a deprecation notice | Q | A | ------------- | --- | Bug fix? | no | New feature? | no | BC breaks? | no | Deprecations? | yes | Tests pass? | yes | Fixed tickets | #12703, #12725 | License | MIT | Doc PR | n/a Commits ------- a901ca2 [Process] added a deprecation notice