Skip to content

Commit

Permalink
InteractiveWizard: Fix retry on incorrect user answer
Browse files Browse the repository at this point in the history
If a user entered a non existent choice, and was prompted to retry, the initial answer was still used instead of the new answer.
  • Loading branch information
robske110 committed Jan 5, 2022
1 parent 01c58d2 commit 705d3b2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/vwid/wizard/InteractiveWizard.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ protected function get(string $msg, ?string $default = null, array $options = []
if(!empty($options) && $input !== ""){
if(!in_array($input, $options, true)){
$this->message("Please answer with one of the following options (case-sensitive!): ".implode(",", $options));
$this->get($msg, $default, $options);
return $this->get($msg, $default, $options);
}
}

Expand Down

0 comments on commit 705d3b2

Please sign in to comment.