Skip to content
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Corrected returned type (Github code scanning / Psalm issue)
Signed-off-by: Charley Paulus <[email protected]>

Signed-off-by: charleypaulus <[email protected]>
  • Loading branch information
charleypaulus committed Nov 3, 2023
commit 741236f5d2db2d13d81e83687ee27aac7f8c819a
10 changes: 6 additions & 4 deletions core/Command/Preview/Delete.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Output\OutputInterface;
use EmptyIterator;

class Delete extends Command {
protected IDBConnection $connection;
Expand Down Expand Up @@ -96,7 +97,7 @@ private function deletePreviews(OutputInterface $output, bool $oldOnly, string $
$output->writeln('Deleting previews of absent original file (fileid:' . $previewFileId . ')', OutputInterface::VERBOSITY_VERBOSE);
} else {
$output->writeln('Deleting previews of original file ' . substr($filePath, 7) . ' (fileid:' . $previewFileId . ')', OutputInterface::VERBOSITY_VERBOSE);
}
}

$previewFoldersToDeleteCount++;

Expand Down Expand Up @@ -129,11 +130,12 @@ private function getPreviewsToDelete(OutputInterface $output, bool $oldOnly, str
$data = $cursor->fetch();

Check notice

Code scanning / Psalm

PossiblyInvalidMethodCall

Cannot call method on possible int variable $cursor
$cursor->closeCursor();

Check notice

Code scanning / Psalm

PossiblyInvalidMethodCall

Cannot call method on possible int variable $cursor

$output->writeln('Preview folder: ' . $data['path'], OutputInterface::VERBOSITY_VERBOSE);

if ($data === null) {
return [];
$output->writeln('No preview folder found.');
return new EmptyIterator();
}

$output->writeln('Preview folder: ' . $data['path'], OutputInterface::VERBOSITY_VERBOSE);

// Get previews to delete
// Initialize Query Builder
Expand Down