[Console] Make SymfonyQuestionHelper::ask optional by default
This commit is contained in:
parent
d662b2152d
commit
2da429cd0a
@ -72,6 +72,8 @@ Console
|
||||
have been deprecated in favor of the `console.error` event and the `ConsoleErrorEvent`
|
||||
class. The deprecated event and class will be removed in 4.0.
|
||||
|
||||
* The `SymfonyQuestionHelper::ask` default validation has been deprecated and will be removed in 4.0. Apply validation using `Question::setValidator` instead.
|
||||
|
||||
Debug
|
||||
-----
|
||||
|
||||
|
@ -61,6 +61,8 @@ Console
|
||||
* The `console.exception` event and the related `ConsoleExceptionEvent` class have
|
||||
been removed in favor of the `console.error` event and the `ConsoleErrorEvent` class.
|
||||
|
||||
* The `SymfonyQuestionHelper::ask` default validation has been removed in favor of `Question::setValidator`.
|
||||
|
||||
Debug
|
||||
-----
|
||||
|
||||
|
@ -88,7 +88,7 @@ EOF
|
||||
'You can either install it or use the "server:run" command instead.',
|
||||
));
|
||||
|
||||
if ($io->ask('Do you want to execute <info>server:run</info> immediately? [yN] ', false)) {
|
||||
if ($io->confirm('Do you want to execute <info>server:run</info> immediately?', false)) {
|
||||
return $this->getApplication()->find('server:run')->run($input, $output);
|
||||
}
|
||||
|
||||
|
@ -12,6 +12,7 @@ CHANGELOG
|
||||
* deprecated console.exception event in favor of console.error
|
||||
* added ability to handle `CommandNotFoundException` through the
|
||||
`console.error` event
|
||||
* deprecated default validation in `SymfonyQuestionHelper::ask`
|
||||
|
||||
3.2.0
|
||||
------
|
||||
|
@ -29,6 +29,8 @@ class SymfonyQuestionHelper extends QuestionHelper
|
||||
{
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*
|
||||
* To be removed in 4.0
|
||||
*/
|
||||
public function ask(InputInterface $input, OutputInterface $output, Question $question)
|
||||
{
|
||||
@ -39,6 +41,8 @@ class SymfonyQuestionHelper extends QuestionHelper
|
||||
} else {
|
||||
// make required
|
||||
if (!is_array($value) && !is_bool($value) && 0 === strlen($value)) {
|
||||
@trigger_error('The default question validator is deprecated since Symfony 3.3 and will not be used anymore in version 4.0. Set a custom question validator if needed.', E_USER_DEPRECATED);
|
||||
|
||||
throw new LogicException('A value is required.');
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user