]> source.dussan.org Git - nextcloud-server.git/commitdiff
ci: Fix psalm by typing the QuestionHelper
authorJoas Schilling <coding@schilljs.com>
Wed, 2 Oct 2024 21:58:31 +0000 (23:58 +0200)
committerJoas Schilling <coding@schilljs.com>
Mon, 7 Oct 2024 10:11:27 +0000 (12:11 +0200)
Signed-off-by: Joas Schilling <coding@schilljs.com>
apps/files_external/lib/Command/Delete.php
core/Command/Background/Delete.php
core/Command/Config/App/SetConfig.php
core/Command/Db/ConvertFilecacheBigInt.php
core/Command/Db/Migrations/GenerateCommand.php
core/Command/Maintenance/RepairShareOwnership.php
core/Command/Preview/Repair.php

index 61e974ff58957cb467431b8ec5397ddfd87b8465..3e6ccf751a88d224bceb14c8f64ac1939ee9380b 100644 (file)
@@ -13,6 +13,7 @@ use OCA\Files_External\Service\UserStoragesService;
 use OCP\AppFramework\Http;
 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 @@ class Delete extends Base {
                protected UserStoragesService $userService,
                protected IUserSession $userSession,
                protected IUserManager $userManager,
+               protected QuestionHelper $questionHelper,
        ) {
                parent::__construct();
        }
@@ -64,6 +66,7 @@ class Delete extends Base {
                        $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);
 
index 41efaf84665215e63fb86345509add6bf2dcd810..50ae309065b46ada799f4d85c7a879d1c63a073b 100644 (file)
@@ -10,6 +10,7 @@ namespace OC\Core\Command\Background;
 
 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 @@ class Delete extends Base {
                        '/^(y|Y)/i'
                );
 
+               /** @var QuestionHelper $helper */
                $helper = $this->getHelper('question');
                if (!$helper->ask($input, $output, $question)) {
                        $output->writeln('aborted.');
index 461c024d03825c9afbac1692e3afd38498a5c6cd..b1d1632ff1a74a545c3f5fcc448a5a297df9c9c3 100644 (file)
@@ -12,6 +12,7 @@ use OC\AppConfig;
 use OCP\Exceptions\AppConfigIncorrectTypeException;
 use OCP\Exceptions\AppConfigUnknownKeyException;
 use OCP\IAppConfig;
+use Symfony\Component\Console\Helper\QuestionHelper;
 use Symfony\Component\Console\Input\InputArgument;
 use Symfony\Component\Console\Input\InputInterface;
 use Symfony\Component\Console\Input\InputOption;
@@ -229,6 +230,7 @@ class SetConfig extends Base {
        }
 
        private function ask(InputInterface $input, OutputInterface $output, string $request): bool {
+               /** @var QuestionHelper $helper */
                $helper = $this->getHelper('question');
                if ($input->getOption('no-interaction')) {
                        return true;
index d16e6d302312f1a252098d32ecd590a8afe207d9..f5028aacaefd76eccb7474181c3987b9406a9ed7 100644 (file)
@@ -11,6 +11,7 @@ use OC\DB\SchemaWrapper;
 use OCP\DB\Types;
 use OCP\IDBConnection;
 use Symfony\Component\Console\Command\Command;
+use Symfony\Component\Console\Helper\QuestionHelper;
 use Symfony\Component\Console\Input\InputInterface;
 use Symfony\Component\Console\Output\OutputInterface;
 use Symfony\Component\Console\Question\ConfirmationQuestion;
@@ -89,6 +90,7 @@ class ConvertFilecacheBigInt extends Command {
                $output->writeln('<comment>This can take up to hours, depending on the number of files in your instance!</comment>');
 
                if ($input->isInteractive()) {
+                       /** @var QuestionHelper $helper */
                        $helper = $this->getHelper('question');
                        $question = new ConfirmationQuestion('Continue with the conversion (y/n)? [n] ', false);
 
index cd92dc5acd60d952f1bfeada18f42942a6f1fcd5..ed29412f00bdd0d7fbf6a9ad10bca332d4aa2c14 100644 (file)
@@ -15,6 +15,7 @@ use Stecman\Component\Symfony\Console\BashCompletion\Completion\CompletionAwareI
 use Stecman\Component\Symfony\Console\BashCompletion\CompletionContext;
 use Symfony\Component\Console\Command\Command;
 use Symfony\Component\Console\Exception\RuntimeException;
+use Symfony\Component\Console\Helper\QuestionHelper;
 use Symfony\Component\Console\Input\InputArgument;
 use Symfony\Component\Console\Input\InputInterface;
 use Symfony\Component\Console\Output\OutputInterface;
@@ -117,6 +118,7 @@ class {{classname}} extends SimpleMigrationStep {
                                $output->writeln('<comment> - Actual:   ' . $version . '</comment>');
 
                                if ($input->isInteractive()) {
+                                       /** @var QuestionHelper $helper */
                                        $helper = $this->getHelper('question');
                                        $question = new ConfirmationQuestion('Continue with your given version? (y/n) [n] ', false);
 
index a24be53b00ef4bc4153ebf381420c7ee3baeea79..16675545afea7497640e37699b62b738a5f8e540 100644 (file)
@@ -14,6 +14,7 @@ use OCP\IDBConnection;
 use OCP\IUser;
 use OCP\IUserManager;
 use Symfony\Component\Console\Command\Command;
+use Symfony\Component\Console\Helper\QuestionHelper;
 use Symfony\Component\Console\Input\InputArgument;
 use Symfony\Component\Console\Input\InputInterface;
 use Symfony\Component\Console\Input\InputOption;
@@ -60,6 +61,7 @@ class RepairShareOwnership extends Command {
                        $output->writeln('');
 
                        if (!$noConfirm) {
+                               /** @var QuestionHelper $helper */
                                $helper = $this->getHelper('question');
                                $question = new ConfirmationQuestion('Repair these shares? [y/N]', false);
 
index 641e204e0502bb2e010fa0c48beb47de3ff28feb..3ccd82313002aee67c4ad01850a501c6f69cd316 100644 (file)
@@ -19,6 +19,7 @@ use OCP\Lock\LockedException;
 use Psr\Log\LoggerInterface;
 use Symfony\Component\Console\Command\Command;
 use Symfony\Component\Console\Helper\ProgressBar;
+use Symfony\Component\Console\Helper\QuestionHelper;
 use Symfony\Component\Console\Input\InputInterface;
 use Symfony\Component\Console\Input\InputOption;
 use Symfony\Component\Console\Output\OutputInterface;
@@ -133,6 +134,7 @@ class Repair extends Command {
                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('<info>Should the migration be started? (y/[n]) </info>', false);