Added setInputStream deprecation to UPGRADE guides
This commit is contained in:
parent
d0ac91a815
commit
6f53465648
@ -11,6 +11,51 @@ Console
|
|||||||
|
|
||||||
* Setting unknown style options is deprecated and will throw an exception in
|
* Setting unknown style options is deprecated and will throw an exception in
|
||||||
Symfony 4.0.
|
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
|
DependencyInjection
|
||||||
-------------------
|
-------------------
|
||||||
@ -21,9 +66,9 @@ DependencyInjection
|
|||||||
ExpressionLanguage
|
ExpressionLanguage
|
||||||
-------------------
|
-------------------
|
||||||
|
|
||||||
* Passing a `ParserCacheInterface` instance to the `ExpressionLanguage` has been
|
* Passing a `ParserCacheInterface` instance to the `ExpressionLanguage` has been
|
||||||
deprecated and will not be supported in Symfony 4.0. You should use the
|
deprecated and will not be supported in Symfony 4.0. You should use the
|
||||||
`CacheItemPoolInterface` interface instead.
|
`CacheItemPoolInterface` interface instead.
|
||||||
|
|
||||||
Form
|
Form
|
||||||
----
|
----
|
||||||
|
@ -6,6 +6,51 @@ Console
|
|||||||
|
|
||||||
* Setting unknown style options is not supported anymore and throws an
|
* Setting unknown style options is not supported anymore and throws an
|
||||||
exception.
|
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
|
Debug
|
||||||
-----
|
-----
|
||||||
|
Reference in New Issue
Block a user