Skip to content

Commit

Permalink
fix: change file name utility class name in delete command
Browse files Browse the repository at this point in the history
  • Loading branch information
dvdmlln committed Jul 18, 2024
1 parent 6556447 commit ddc747a
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions Classes/Command/DeleteBackupCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

namespace Remind\Backup\Command;

use Remind\Backup\Utility\FileNameUtility;
use Remind\Backup\Utility\FileNamingUtility;
use Symfony\Component\Console\Command\Command;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Input\InputOption;
Expand Down Expand Up @@ -70,13 +70,13 @@ protected function execute(InputInterface $input, OutputInterface $output): int

$files = array_values(array_diff(scandir($dir, SCANDIR_SORT_ASCENDING), ['.', '..']));
$matches = array_filter($files, function (string $fileToCheck) use ($file) {
return preg_match(FileNameUtility::getRegexPattern($file), $fileToCheck);
return preg_match(FileNamingUtility::getRegexPattern($file), $fileToCheck);
});

$filesToBeDeleted = array_slice($matches, 0, -$input->getOption(self::INPUT_KEEP_COUNT));

foreach ($filesToBeDeleted as $file) {
unlink(FileNameUtility::buildPath($dir, $file));
unlink(FileNamingUtility::buildPath($dir, $file));
}

return Command::SUCCESS;
Expand Down

0 comments on commit ddc747a

Please sign in to comment.