Skip to content
Open
Changes from all commits
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
6 changes: 4 additions & 2 deletions Classes/Command/CompressImagesCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -95,8 +95,10 @@ protected function execute(InputInterface $input, OutputInterface $output): void
foreach ($this->fileStorageRepository->findAll() as $fileStorage) {
$excludeFolders = GeneralUtility::trimExplode(',', (string)$settings['excludeFolders'], true);
$files = $this->fileRepository->findAllNonCompressedInStorageWithLimit($fileStorage, $limit, $excludeFolders);
$this->compressImages($files);
$this->clearPageCache();
if (count($files) > 0) {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

only use count() if there is always an array, othwise we'll get a PHP warning from PHP 7.2+. Safer it's to use if (!empty($files)) plus it's also faster than count.

$this->compressImages($files);
$this->clearPageCache();
}
}
}

Expand Down