Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 2da429c

Browse filesBrowse files
committed
[Console] Make SymfonyQuestionHelper::ask optional by default
1 parent d662b21 commit 2da429c
Copy full SHA for 2da429c

File tree

Expand file treeCollapse file tree

5 files changed

+10
-1
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

5 files changed

+10
-1
lines changed
Open diff view settings
Collapse file

‎UPGRADE-3.3.md‎

Copy file name to clipboardExpand all lines: UPGRADE-3.3.md
+2Lines changed: 2 additions & 0 deletions
  • Display the source diff
  • Display the rich diff
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,8 @@ Console
7272
have been deprecated in favor of the `console.error` event and the `ConsoleErrorEvent`
7373
class. The deprecated event and class will be removed in 4.0.
7474

75+
* The `SymfonyQuestionHelper::ask` default validation has been deprecated and will be removed in 4.0. Apply validation using `Question::setValidator` instead.
76+
7577
Debug
7678
-----
7779

Collapse file

‎UPGRADE-4.0.md‎

Copy file name to clipboardExpand all lines: UPGRADE-4.0.md
+2Lines changed: 2 additions & 0 deletions
  • Display the source diff
  • Display the rich diff
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,8 @@ Console
6161
* The `console.exception` event and the related `ConsoleExceptionEvent` class have
6262
been removed in favor of the `console.error` event and the `ConsoleErrorEvent` class.
6363

64+
* The `SymfonyQuestionHelper::ask` default validation has been removed in favor of `Question::setValidator`.
65+
6466
Debug
6567
-----
6668

Collapse file

‎src/Symfony/Bundle/WebServerBundle/Command/ServerStartCommand.php‎

Copy file name to clipboardExpand all lines: src/Symfony/Bundle/WebServerBundle/Command/ServerStartCommand.php
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ protected function execute(InputInterface $input, OutputInterface $output)
8888
'You can either install it or use the "server:run" command instead.',
8989
));
9090

91-
if ($io->ask('Do you want to execute <info>server:run</info> immediately? [yN] ', false)) {
91+
if ($io->confirm('Do you want to execute <info>server:run</info> immediately?', false)) {
9292
return $this->getApplication()->find('server:run')->run($input, $output);
9393
}
9494

Collapse file

‎src/Symfony/Component/Console/CHANGELOG.md‎

Copy file name to clipboardExpand all lines: src/Symfony/Component/Console/CHANGELOG.md
+1Lines changed: 1 addition & 0 deletions
  • Display the source diff
  • Display the rich diff
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ CHANGELOG
1212
* deprecated console.exception event in favor of console.error
1313
* added ability to handle `CommandNotFoundException` through the
1414
`console.error` event
15+
* deprecated default validation in `SymfonyQuestionHelper::ask`
1516

1617
3.2.0
1718
------
Collapse file

‎src/Symfony/Component/Console/Helper/SymfonyQuestionHelper.php‎

Copy file name to clipboardExpand all lines: src/Symfony/Component/Console/Helper/SymfonyQuestionHelper.php
+4Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@ class SymfonyQuestionHelper extends QuestionHelper
2929
{
3030
/**
3131
* {@inheritdoc}
32+
*
33+
* To be removed in 4.0
3234
*/
3335
public function ask(InputInterface $input, OutputInterface $output, Question $question)
3436
{
@@ -39,6 +41,8 @@ public function ask(InputInterface $input, OutputInterface $output, Question $qu
3941
} else {
4042
// make required
4143
if (!is_array($value) && !is_bool($value) && 0 === strlen($value)) {
44+
@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);
45+
4246
throw new LogicException('A value is required.');
4347
}
4448
}

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.