Added setInputStream deprecation to UPGRADE guides

This commit is contained in:
WouterJ 2017-03-05 13:22:56 +01:00 committed by Fabien Potencier
parent d0ac91a815
commit 6f53465648
2 changed files with 93 additions and 3 deletions

View File

@ -11,6 +11,51 @@ Console
* Setting unknown style options is deprecated and will throw an exception in
Symfony 4.0.
* The `QuestionHelper::setInputStream()` method is deprecated and will be
removed in Symfony 4.0. Use `StreamableInputInterface::setStream()` or
`CommandTester::setInputs()` instead.
Before:
```php
$input = new ArrayInput();
$questionHelper->setInputStream($stream);
$questionHelper->ask($input, $output, $question);
```
After:
```php
$input = new ArrayInput();
$input->setStream($stream);
$questionHelper->ask($input, $output, $question);
```
Before:
```php
$commandTester = new CommandTester($command);
$stream = fopen('php://memory', 'r+', false);
fputs($stream, "AppBundle\nYes");
rewind($stream);
$command->getHelper('question')->setInputStream($stream);
$commandTester->execute();
```
After:
```php
$commandTester = new CommandTester($command);
$commandTester->setInputs(array('AppBundle', 'Yes'));
$commandTester->execute();
```
DependencyInjection
-------------------
@ -21,9 +66,9 @@ DependencyInjection
ExpressionLanguage
-------------------
* Passing a `ParserCacheInterface` instance to the `ExpressionLanguage` has been
deprecated and will not be supported in Symfony 4.0. You should use the
`CacheItemPoolInterface` interface instead.
* Passing a `ParserCacheInterface` instance to the `ExpressionLanguage` has been
deprecated and will not be supported in Symfony 4.0. You should use the
`CacheItemPoolInterface` interface instead.
Form
----

View File

@ -6,6 +6,51 @@ Console
* Setting unknown style options is not supported anymore and throws an
exception.
* The `QuestionHelper::setInputStream()` method is removed. Use
`StreamableInputInterface::setStream()` or `CommandTester::setInputs()`
instead.
Before:
```php
$input = new ArrayInput();
$questionHelper->setInputStream($stream);
$questionHelper->ask($input, $output, $question);
```
After:
```php
$input = new ArrayInput();
$input->setStream($stream);
$questionHelper->ask($input, $output, $question);
```
Before:
```php
$commandTester = new CommandTester($command);
$stream = fopen('php://memory', 'r+', false);
fputs($stream, "AppBundle\nYes");
rewind($stream);
$command->getHelper('question')->setInputStream($stream);
$commandTester->execute();
```
After:
```php
$commandTester = new CommandTester($command);
$commandTester->setInputs(array('AppBundle', 'Yes'));
$commandTester->execute();
```
Debug
-----