Skip to content
Prev Previous commit
Next Next commit
ci: Fix psalm by typing the QuestionHelper
Signed-off-by: Joas Schilling <[email protected]>
  • Loading branch information
nickvergessen committed Oct 7, 2024
commit c109ae9437403c5bd17834c2ee53507c1d1f2ad2
3 changes: 3 additions & 0 deletions apps/files_external/lib/Command/Delete.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
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;
Expand All @@ -26,6 +27,7 @@ public function __construct(
protected UserStoragesService $userService,
protected IUserSession $userSession,
protected IUserManager $userManager,
protected QuestionHelper $questionHelper,
) {
parent::__construct();
}
Expand Down Expand Up @@ -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);

Expand Down
2 changes: 2 additions & 0 deletions core/Command/Background/Delete.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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.');
Expand Down
2 changes: 2 additions & 0 deletions core/Command/Config/App/SetConfig.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
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;
Expand Down Expand Up @@ -229,6 +230,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;
Expand Down
2 changes: 2 additions & 0 deletions core/Command/Db/ConvertFilecacheBigInt.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
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;
Expand Down Expand Up @@ -89,6 +90,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int
$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);

Expand Down
2 changes: 2 additions & 0 deletions core/Command/Db/Migrations/GenerateCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
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;
Expand Down Expand Up @@ -117,6 +118,7 @@ public function execute(InputInterface $input, OutputInterface $output): int {
$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);

Expand Down
2 changes: 2 additions & 0 deletions core/Command/Maintenance/RepairShareOwnership.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
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;
Expand Down Expand Up @@ -60,6 +61,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);

Expand Down
2 changes: 2 additions & 0 deletions core/Command/Preview/Repair.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
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;
Expand Down Expand Up @@ -133,6 +134,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('<info>Should the migration be started? (y/[n]) </info>', false);

Expand Down