Skip to content

Commit

Permalink
Add support for Command::confirm()
Browse files Browse the repository at this point in the history
Signed-off-by: Mior Muhammad Zaki <crynobone@gmail.com>
  • Loading branch information
crynobone committed Dec 7, 2022
1 parent 563a8b2 commit b7fbe4c
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/Console/Util/CreateUserOptions.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,18 @@ public function __construct(callable $callback)
$this->questions = new Collection(call_user_func($callback, $this));
}

/**
* Confirm a question with the user.
*
* @param string $question
* @param string|null $default
* @return array
*/
public function confirm(string $question, $default = false)
{
return [$this->parseQuestion($question), null, InputOption::VALUE_NONE, ''];
}

/**
* Prompt the user for input.
*
Expand Down

0 comments on commit b7fbe4c

Please sign in to comment.