Skip to content

[WIP] [Console] added a better way to ask questions to the user #9811

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions UPGRADE-3.0.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@ UPGRADE FROM 2.x to 3.0
`DebugClassLoader`. The difference is that the constructor now takes a
loader to wrap.

### Console

* The `dialog` helper has been removed in favor of the `question` helper.

### Form

* The methods `Form::bind()` and `Form::isBound()` were removed. You should
Expand Down
4 changes: 3 additions & 1 deletion src/Symfony/Component/Console/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@ CHANGELOG
2.5.0
-----

* added a way to set the process name of a command
* deprecated the dialog helper (use the question helper instead)
* added a question helper
* added a way to set the process name of a command

2.4.0
-----
Expand Down
7 changes: 5 additions & 2 deletions src/Symfony/Component/Console/Helper/DialogHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@
* The Dialog class provides helpers to interact with the user.
*
* @author Fabien Potencier <fabien@symfony.com>
*
* @deprecated Deprecated since version 2.5, to be removed in 3.0.
* Use the question helper instead.
*/
class DialogHelper extends InputAwareHelper
{
Expand Down Expand Up @@ -337,7 +340,7 @@ public function askAndValidate(OutputInterface $output, $question, $validator, $
{
$that = $this;

$interviewer = function() use ($output, $question, $default, $autocomplete, $that) {
$interviewer = function () use ($output, $question, $default, $autocomplete, $that) {
return $that->ask($output, $question, $default, $autocomplete);
};

Expand Down Expand Up @@ -367,7 +370,7 @@ public function askHiddenResponseAndValidate(OutputInterface $output, $question,
{
$that = $this;

$interviewer = function() use ($output, $question, $fallback, $that) {
$interviewer = function () use ($output, $question, $fallback, $that) {
return $that->askHiddenResponse($output, $question, $fallback);
};

Expand Down
Loading