Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Removed deprecations in Process component #14147

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

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions src/Symfony/Component/Process/Process.php
Original file line number Diff line number Diff line change
Expand Up @@ -1078,8 +1078,6 @@ public function getInput()
* @return self The current Process instance
*
* @throws LogicException In case the process is running
*
* Passing an object as an input is deprecated since version 2.5 and will be removed in 3.0.
*/
public function setInput($input)
{
Expand Down
2 changes: 0 additions & 2 deletions src/Symfony/Component/Process/ProcessBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -172,8 +172,6 @@ public function addEnvironmentVariables(array $variables)
* @return ProcessBuilder
*
* @throws InvalidArgumentException In case the argument is invalid
*
* Passing an object as an input is deprecated since version 2.5 and will be removed in 3.0.
*/
public function setInput($input)
{
Expand Down
8 changes: 0 additions & 8 deletions src/Symfony/Component/Process/ProcessUtils.php
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,6 @@ public static function escapeArgument($argument)
* @return string The validated input
*
* @throws InvalidArgumentException In case the input is not valid
*
* Passing an object as an input is deprecated since version 2.5 and will be removed in 3.0.
*/
public static function validateInput($caller, $input)
{
Expand All @@ -95,12 +93,6 @@ public static function validateInput($caller, $input)
if (is_scalar($input)) {
return (string) $input;
}
// deprecated as of Symfony 2.5, to be removed in 3.0
if (is_object($input) && method_exists($input, '__toString')) {
trigger_error('Passing an object as an input is deprecated since version 2.5 and will be removed in 3.0.', E_USER_DEPRECATED);

return (string) $input;
}

throw new InvalidArgumentException(sprintf('%s only accepts strings or stream resources.', $caller));
}
Expand Down
28 changes: 0 additions & 28 deletions src/Symfony/Component/Process/Tests/AbstractProcessTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -232,26 +232,6 @@ public function provideInputValues()
);
}

/**
* @dataProvider provideLegacyInputValues
* @group legacy
*/
public function testLegacyValidInput($expected, $value)
{
$this->iniSet('error_reporting', -1 & ~E_USER_DEPRECATED);

$process = $this->getProcess('php -v');
$process->setInput($value);
$this->assertSame($expected, $process->getInput());
}

public function provideLegacyInputValues()
{
return array(
array('stringifiable', new Stringifiable()),
);
}

public function chainedCommandsOutputProvider()
{
if ('\\' === DIRECTORY_SEPARATOR) {
Expand Down Expand Up @@ -1191,14 +1171,6 @@ public function methodProvider()
abstract protected function getProcess($commandline, $cwd = null, array $env = null, $input = null, $timeout = 60, array $options = array());
}

class Stringifiable
{
public function __toString()
{
return 'stringifiable';
}
}

class NonStringifiable
{
}