]> BookStack Code Mirror - system-cli/blob - scripts/Services/InteractiveConsole.php
Progressed restore command to almost working state
[system-cli] / scripts / Services / InteractiveConsole.php
1 <?php
2
3 namespace Cli\Services;
4
5 use Symfony\Component\Console\Helper\QuestionHelper;
6 use Symfony\Component\Console\Input\InputInterface;
7 use Symfony\Component\Console\Output\OutputInterface;
8 use Symfony\Component\Console\Question\ConfirmationQuestion;
9
10 class InteractiveConsole
11 {
12
13
14     public function __construct(
15         protected QuestionHelper $helper,
16         protected InputInterface $input,
17         protected OutputInterface $output,
18     )
19     {
20     }
21
22     public function confirm(string $text): bool
23     {
24         $question = new ConfirmationQuestion($text . " (y/n)\n", false);
25         return $this->helper->ask($this->input, $this->output, $question);
26     }
27 }