Skip to content

Commit

Permalink
fixed a minor issue
Browse files Browse the repository at this point in the history
  • Loading branch information
ardabeyazoglu committed Feb 6, 2024
1 parent c50150b commit 3c93609
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions src/Retention.php
Original file line number Diff line number Diff line change
Expand Up @@ -185,17 +185,17 @@ public function apply(string $baseDir): Result
$this->logger->notice('There must be at least one file to keep.', [
'baseDir' => $baseDir,
]);
return $keepList;
}

if ($this->dryRun) {
$this->logger->debug('No policy applied because of dry-run.');
}
else {
foreach ($pruneList as $fileInfo) {
/** @var FileInfo $fileInfo */
if (!$this->pruneFile($fileInfo)) {
throw new RetentionException("Pruning {$fileInfo->path} failed unexpectedly.");
if ($this->dryRun) {
$this->logger->debug('No policy applied because of dry-run.');
}
else {
foreach ($pruneList as $fileInfo) {
/** @var FileInfo $fileInfo */
if (!$this->pruneFile($fileInfo)) {
throw new RetentionException("Pruning {$fileInfo->path} failed unexpectedly.");
}
}
}
}
Expand Down

0 comments on commit 3c93609

Please sign in to comment.