8000 [Process] added a deprecation notice · symfony/symfony@5bce1d3 · GitHub
[go: up one dir, main page]

Skip to content

Commit 5bce1d3

Browse files
committed
[Process] added a deprecation notice
1 parent 23253c4 commit 5bce1d3

File tree

3 files changed

+10
-4
lines changed

3 files changed

+10
-4
lines changed

src/Symfony/Component/Process/Process.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1108,11 +1108,13 @@ public function setStdin($stdin)
11081108
*
11091109
* This content will be passed to the underlying process standard input.
11101110
*
1111-
* @param string|null $input The content
1111+
* @param mixed $input The content
11121112
*
11131113
* @return self The current Process instance
11141114
*
11151115
* @throws LogicException In case the process is running
1116+
*
1117+
* @deprecated Passing an object as an input is deprecated since version 2.5 and will be removed in 3.0.
11161118
*/
11171119
public function setInput($input)
11181120
{

src/Symfony/Component/Process/ProcessBuilder.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -167,13 +167,13 @@ public function addEnvironmentVariables(array $variables)
167167
/**
168168
* Sets the input of the process.
169169
*
170-
* Deprecation: As of Symfony 2.5, this method only accepts string values.
171-
*
172-
* @param string|null $input The input as a string
170+
* @param mixed $input The input as a string
173171
*
174172
* @return ProcessBuilder
175173
*
176174
* @throws InvalidArgumentException In case the argument is invalid
175+
*
176+
* @deprecated Passing an object as an input is deprecated since version 2.5 and will be removed in 3.0.
177177
*/
178178
public function setInput($input)
179179
{

src/Symfony/Component/Process/ProcessUtils.php

Lines changed: 4 additions & 0 deletions

0 commit comments

Comments
 (0)
0
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,8 @@ public static function escapeArgument($argument)
8383
* @return string The validated input
8484
*
8585
* @throws InvalidArgumentException In case the input is not valid
86+
*
87+
* @deprecated Passing an object as an input is deprecated since version 2.5 and will be removed in 3.0.
8688
*/
8789
public static function validateInput($caller, $input)
8890
{
@@ -95,6 +97,8 @@ public static function validateInput($caller, $input)
9597
}
9698
// deprecated as of Symfony 2.5, to be removed in 3.0
9799
if (is_object($input) && method_exists($input, '__toString')) {
100+
trigger_error('Passing an object as an input is deprecated since version 2.5 and will be removed in 3.0.', E_USER_DEPRECATED);
101+
98102
return (string) $input;
99103
}
100104