From f72ca7a10234138e90cc9622490927bbfe4ed03b Mon Sep 17 00:00:00 2001 From: michalsn Date: Wed, 27 Dec 2023 12:45:46 +0100 Subject: [PATCH] fix rector --- docs/configuration.md | 4 +--- src/Minifier.php | 3 ++- tests/_support/CLITestCase.php | 2 +- 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/docs/configuration.md b/docs/configuration.md index a221aed..ba57fd7 100644 --- a/docs/configuration.md +++ b/docs/configuration.md @@ -20,11 +20,9 @@ public $js = [ 'jquery-3.7.1.min.js', 'bootstrap-3.3.7.min.js', 'main.js', ] ]; -``` -or +// or / and -```php public $css = [ 'all.min.css' => [ 'bootstrap-3.3.7.min.css', 'font-awesome-4.7.0.min.css', 'main.css', diff --git a/src/Minifier.php b/src/Minifier.php index 736aaef..fd5cfe0 100644 --- a/src/Minifier.php +++ b/src/Minifier.php @@ -259,7 +259,8 @@ protected function getVersion(string $dir): array */ protected function setVersion(string $mode, array $files, string $dir): void { - $dir = rtrim($dir, '/'); + $versions = []; + $dir = rtrim($dir, '/'); if (file_exists($dir . '/versions.json')) { $versions = json_decode(file_get_contents($dir . '/versions.json'), true); diff --git a/tests/_support/CLITestCase.php b/tests/_support/CLITestCase.php index c30dc00..9b7880e 100644 --- a/tests/_support/CLITestCase.php +++ b/tests/_support/CLITestCase.php @@ -34,7 +34,7 @@ protected function removeColorCodes(string $output): string { $colors = $this->getPrivateProperty(CLI::class, 'foreground_colors'); $colors = array_values(array_map(static fn ($color) => "\033[" . $color . 'm', $colors)); - $colors = array_merge(["\033[0m"], $colors); + $colors = ["\033[0m", ...$colors]; $output = str_replace($colors, '', trim($output));