Skip to content

Commit

Permalink
ci: Fix psalm by typing the QuestionHelper
Browse files Browse the repository at this point in the history
Signed-off-by: Joas Schilling <[email protected]>
  • Loading branch information
nickvergessen committed Oct 2, 2024
1 parent e925be0 commit 29391ec
Show file tree
Hide file tree
Showing 8 changed files with 38 additions and 0 deletions.
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 @@ -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;
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
28 changes: 28 additions & 0 deletions build/psalm-baseline.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1266,6 +1266,12 @@
<code><![CDATA[array]]></code>
</LessSpecificImplementedReturnType>
</file>
<file src="core/Command/Config/App/SetConfig.php">
<UndefinedDocblockClass>
<code><![CDATA[$helper]]></code>
<code><![CDATA[$helper]]></code>
</UndefinedDocblockClass>
</file>
<file src="core/Command/Config/Import.php">
<InvalidScalarArgument>
<code><![CDATA[0]]></code>
Expand All @@ -1280,12 +1286,24 @@
<code><![CDATA[getFilteredValues]]></code>
</TooManyArguments>
</file>
<file src="core/Command/Db/ConvertFilecacheBigInt.php">
<UndefinedDocblockClass>
<code><![CDATA[$helper]]></code>
<code><![CDATA[$helper]]></code>
</UndefinedDocblockClass>
</file>
<file src="core/Command/Db/ConvertType.php">
<InvalidScalarArgument>
<code><![CDATA[0]]></code>
<code><![CDATA[1]]></code>
</InvalidScalarArgument>
</file>
<file src="core/Command/Db/Migrations/GenerateCommand.php">
<UndefinedDocblockClass>
<code><![CDATA[$helper]]></code>
<code><![CDATA[$helper]]></code>
</UndefinedDocblockClass>
</file>
<file src="core/Command/Encryption/Enable.php">
<NullArgument>
<code><![CDATA[null]]></code>
Expand Down Expand Up @@ -1315,7 +1333,17 @@
<code><![CDATA[updateFilecache]]></code>
</UndefinedInterfaceMethod>
</file>
<file src="core/Command/Maintenance/RepairShareOwnership.php">
<UndefinedDocblockClass>
<code><![CDATA[$helper]]></code>
<code><![CDATA[$helper]]></code>
</UndefinedDocblockClass>
</file>
<file src="core/Command/Preview/Repair.php">
<UndefinedDocblockClass>
<code><![CDATA[$helper]]></code>
<code><![CDATA[$helper]]></code>
</UndefinedDocblockClass>
<UndefinedInterfaceMethod>
<code><![CDATA[section]]></code>
<code><![CDATA[section]]></code>
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
1 change: 1 addition & 0 deletions core/Command/Config/App/SetConfig.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
1 change: 1 addition & 0 deletions core/Command/Db/ConvertFilecacheBigInt.php
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,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
1 change: 1 addition & 0 deletions core/Command/Db/Migrations/GenerateCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,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
1 change: 1 addition & 0 deletions core/Command/Maintenance/RepairShareOwnership.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);

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

Expand Down

0 comments on commit 29391ec

Please sign in to comment.