diff --git a/apps/files_external/lib/Command/Delete.php b/apps/files_external/lib/Command/Delete.php index 077b969d7b269..429557a0598b9 100644 --- a/apps/files_external/lib/Command/Delete.php +++ b/apps/files_external/lib/Command/Delete.php @@ -12,6 +12,7 @@ use OCA\Files_External\Service\UserStoragesService; use OCP\IUserManager; use OCP\IUserSession; +use Symfony\Component\Console\Helper\QuestionHelper; use Symfony\Component\Console\Input\ArrayInput; use Symfony\Component\Console\Input\InputArgument; use Symfony\Component\Console\Input\InputInterface; @@ -26,6 +27,7 @@ public function __construct( protected UserStoragesService $userService, protected IUserSession $userSession, protected IUserManager $userManager, + protected QuestionHelper $questionHelper, ) { parent::__construct(); } @@ -64,6 +66,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int $listInput->setOption('output', $input->getOption('output')); $listCommand->listMounts(null, [$mount], $listInput, $output); + /** @var QuestionHelper $questionHelper */ $questionHelper = $this->getHelper('question'); $question = new ConfirmationQuestion('Delete this mount? [y/N] ', false); diff --git a/build/psalm-baseline.xml b/build/psalm-baseline.xml index 16fe161a9ba4d..083395c46ff6b 100644 --- a/build/psalm-baseline.xml +++ b/build/psalm-baseline.xml @@ -1266,6 +1266,12 @@ + + + + + + @@ -1280,12 +1286,24 @@ + + + + + + + + + + + + @@ -1315,7 +1333,17 @@ + + + + + + + + + + diff --git a/core/Command/Background/Delete.php b/core/Command/Background/Delete.php index 41efaf8466521..50ae309065b46 100644 --- a/core/Command/Background/Delete.php +++ b/core/Command/Background/Delete.php @@ -10,6 +10,7 @@ use OC\Core\Command\Base; use OCP\BackgroundJob\IJobList; +use Symfony\Component\Console\Helper\QuestionHelper; use Symfony\Component\Console\Input\InputArgument; use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Output\OutputInterface; @@ -51,6 +52,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int '/^(y|Y)/i' ); + /** @var QuestionHelper $helper */ $helper = $this->getHelper('question'); if (!$helper->ask($input, $output, $question)) { $output->writeln('aborted.'); diff --git a/core/Command/Config/App/SetConfig.php b/core/Command/Config/App/SetConfig.php index 461c024d03825..0d11313d071db 100644 --- a/core/Command/Config/App/SetConfig.php +++ b/core/Command/Config/App/SetConfig.php @@ -229,6 +229,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int } private function ask(InputInterface $input, OutputInterface $output, string $request): bool { + /** @var QuestionHelper $helper */ $helper = $this->getHelper('question'); if ($input->getOption('no-interaction')) { return true; diff --git a/core/Command/Db/ConvertFilecacheBigInt.php b/core/Command/Db/ConvertFilecacheBigInt.php index d16e6d302312f..948cbe6cba297 100644 --- a/core/Command/Db/ConvertFilecacheBigInt.php +++ b/core/Command/Db/ConvertFilecacheBigInt.php @@ -89,6 +89,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int $output->writeln('This can take up to hours, depending on the number of files in your instance!'); if ($input->isInteractive()) { + /** @var QuestionHelper $helper */ $helper = $this->getHelper('question'); $question = new ConfirmationQuestion('Continue with the conversion (y/n)? [n] ', false); diff --git a/core/Command/Db/Migrations/GenerateCommand.php b/core/Command/Db/Migrations/GenerateCommand.php index cd92dc5acd60d..819e0b30f9c17 100644 --- a/core/Command/Db/Migrations/GenerateCommand.php +++ b/core/Command/Db/Migrations/GenerateCommand.php @@ -117,6 +117,7 @@ public function execute(InputInterface $input, OutputInterface $output): int { $output->writeln(' - Actual: ' . $version . ''); if ($input->isInteractive()) { + /** @var QuestionHelper $helper */ $helper = $this->getHelper('question'); $question = new ConfirmationQuestion('Continue with your given version? (y/n) [n] ', false); diff --git a/core/Command/Maintenance/RepairShareOwnership.php b/core/Command/Maintenance/RepairShareOwnership.php index a24be53b00ef4..ab65183519818 100644 --- a/core/Command/Maintenance/RepairShareOwnership.php +++ b/core/Command/Maintenance/RepairShareOwnership.php @@ -60,6 +60,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int $output->writeln(''); if (!$noConfirm) { + /** @var QuestionHelper $helper */ $helper = $this->getHelper('question'); $question = new ConfirmationQuestion('Repair these shares? [y/N]', false); diff --git a/core/Command/Preview/Repair.php b/core/Command/Preview/Repair.php index 641e204e0502b..3ed76133e2074 100644 --- a/core/Command/Preview/Repair.php +++ b/core/Command/Preview/Repair.php @@ -133,6 +133,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int if ($input->getOption('batch')) { $output->writeln('Batch mode active: migration is started right away.'); } else { + /** @var QuestionHelper $helper */ $helper = $this->getHelper('question'); $question = new ConfirmationQuestion('Should the migration be started? (y/[n]) ', false);