diff --git a/.git-blame-ignore-revs b/.git-blame-ignore-revs index 83dd5c05..388ef37a 100644 --- a/.git-blame-ignore-revs +++ b/.git-blame-ignore-revs @@ -16,3 +16,4 @@ e9a4dfa07fa462e92828a0a1cdfa72d20f4fa7b9 3afb045fbc17e8938d82753bee0fb9c3c0bddcac c26f5c08fa85972b95297b748c394971c3bc893e 71c87c056fa275d369a25be7f2d42b0416f60fc9 +0d85a72d6fe58f2235e9d78aba62881a1c0a21cc diff --git a/app/Services/Backup/Backup.php b/app/Services/Backup/Backup.php index 640a33a7..a9f01ab6 100644 --- a/app/Services/Backup/Backup.php +++ b/app/Services/Backup/Backup.php @@ -545,14 +545,6 @@ protected function logWithTimestamp(string $message, string $timezone): string return '[' . $timestamp . '] ' . $message . "\n"; } - /** - * @param BackupDestinationInterface $backupDestination - * @param int $backupTaskId - * @param int $backupLimit - * @param string $fileExtension - * @param string $pattern - * @return void - */ protected function rotateOldBackups( BackupDestinationInterface $backupDestination, int $backupTaskId, @@ -571,15 +563,17 @@ protected function rotateOldBackups( while (count($files) > $backupLimit) { $oldestFile = array_pop($files); - if (!is_array($oldestFile)) { + if (! is_array($oldestFile)) { $this->logError('Invalid file structure encountered.', ['file' => $oldestFile]); + continue; } $file = $oldestFile['Key'] ?? $oldestFile['name'] ?? null; - if (!is_string($file)) { + if (! is_string($file)) { $this->logError('Invalid file name or key.', ['file' => $oldestFile]); + continue; }