diff --git a/src/Symfony/Component/Console/Input/ArgvInput.php b/src/Symfony/Component/Console/Input/ArgvInput.php index 2618c0691a..9addf1483d 100644 --- a/src/Symfony/Component/Console/Input/ArgvInput.php +++ b/src/Symfony/Component/Console/Input/ArgvInput.php @@ -68,7 +68,6 @@ class ArgvInput extends Input protected function setTokens(array $tokens) { $this->tokens = $tokens; - $this->parse(); } /** diff --git a/src/Symfony/Component/Console/Input/StringInput.php b/src/Symfony/Component/Console/Input/StringInput.php index 93b1b83bb1..5a26676d3c 100644 --- a/src/Symfony/Component/Console/Input/StringInput.php +++ b/src/Symfony/Component/Console/Input/StringInput.php @@ -33,6 +33,8 @@ class StringInput extends ArgvInput * @param string $input An array of parameters from the CLI (in the argv format) * @param InputDefinition $definition A InputDefinition instance * + * @deprecated The second argument is deprecated as it does not work (will be removed in 3.0), use 'bind' method instead + * * @api */ public function __construct($input, InputDefinition $definition = null) diff --git a/src/Symfony/Component/Console/Tests/Input/StringInputTest.php b/src/Symfony/Component/Console/Tests/Input/StringInputTest.php index 4a165d4a30..fd252c87d3 100644 --- a/src/Symfony/Component/Console/Tests/Input/StringInputTest.php +++ b/src/Symfony/Component/Console/Tests/Input/StringInputTest.php @@ -11,9 +11,9 @@ namespace Symfony\Component\Console\Tests\Input; -use Symfony\Component\Console\Input\StringInput; use Symfony\Component\Console\Input\InputDefinition; use Symfony\Component\Console\Input\InputOption; +use Symfony\Component\Console\Input\StringInput; class StringInputTest extends \PHPUnit_Framework_TestCase { @@ -35,7 +35,8 @@ class StringInputTest extends \PHPUnit_Framework_TestCase array(new InputOption('foo', null, InputOption::VALUE_REQUIRED)) ); - $input = new StringInput('--foo=bar', $definition); + $input = new StringInput('--foo=bar'); + $input->bind($definition); $actual = $input->getOption('foo'); $this->assertEquals('bar', $actual);