diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml new file mode 100644 index 000000000..67f8d85d4 --- /dev/null +++ b/.github/workflows/lint.yml @@ -0,0 +1,25 @@ +name: test + +on: + push: + branches: [ master ] + pull_request: + types: [opened, synchronize, reopened, ready_for_review] + +jobs: + unit: + runs-on: ubuntu-latest + strategy: + matrix: + php-versions: [ '7.4' ] + steps: + - uses: actions/checkout@v4 + + - name: Setup PHP + uses: shivammathur/setup-php@v2 + with: + php-version: ${{ matrix.php-versions }} + tools: cs2pr, parallel-lint + + - name: Lint sources + run: composer exec --no-interaction -- parallel-lint bin/ contrib/ recipe/ src/ tests/ --checkstyle | cs2pr diff --git a/Dockerfile b/Dockerfile index bd7b249ba..e4462367f 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM php:7.4-cli-alpine +FROM php:8.3-cli-alpine RUN apk add --no-cache bash git openssh-client rsync diff --git a/bin/dep b/bin/dep index b4c3d689b..43637c8fb 100755 Binary files a/bin/dep and b/bin/dep differ diff --git a/deployer.phar b/deployer.phar index b4c3d689b..43637c8fb 100644 Binary files a/deployer.phar and b/deployer.phar differ diff --git a/recipe/laravel.php b/recipe/laravel.php index 114efc850..721d3684d 100644 --- a/recipe/laravel.php +++ b/recipe/laravel.php @@ -247,10 +247,10 @@ function laravel_version_compare($version, $comparator) */ desc('Starts the Reverb server'); -task('artisan:reverb:start', artisan('pulse:start')); +task('artisan:reverb:start', artisan('reverb:start')); desc('Restarts the Reverb server'); -task('artisan:reverb:restart', artisan('pulse:restart')); +task('artisan:reverb:restart', artisan('reverb:restart')); /* * Pulse. diff --git a/recipe/magento2.php b/recipe/magento2.php index ca1b19f2d..bc2e97f80 100644 --- a/recipe/magento2.php +++ b/recipe/magento2.php @@ -10,6 +10,8 @@ use Deployer\Exception\RunException; use Deployer\Host\Host; +use function Deployer\Support\array_is_list; + const CONFIG_IMPORT_NEEDED_EXIT_CODE = 2; const DB_UPDATE_NEEDED_EXIT_CODE = 2; const MAINTENANCE_MODE_ACTIVE_OUTPUT_MSG = 'maintenance mode is active'; diff --git a/recipe/symfony.php b/recipe/symfony.php index f5d9d312d..6435be28d 100644 --- a/recipe/symfony.php +++ b/recipe/symfony.php @@ -66,7 +66,7 @@ desc('Optimize environment variables'); task('deploy:dump-env', function () { within('{{release_or_current_path}}', function () { - run('{{bin/composer}} dump-env "${APP_ENV:-prod}"'); + run('{{bin/composer}} dump-env'); }); }); diff --git a/src/Component/PharUpdate/Update.php b/src/Component/PharUpdate/Update.php index 9b850d411..004d12f81 100644 --- a/src/Component/PharUpdate/Update.php +++ b/src/Component/PharUpdate/Update.php @@ -101,7 +101,7 @@ public function copyTo(string $file): void ); } - $mode = 0o755; + $mode = 0755; if (file_exists($file)) { $mode = fileperms($file) & 511; diff --git a/src/Documentation/DocGen.php b/src/Documentation/DocGen.php index 0e8ee636a..29cebac77 100644 --- a/src/Documentation/DocGen.php +++ b/src/Documentation/DocGen.php @@ -1,4 +1,4 @@ -= 8.0 declare(strict_types=1); diff --git a/src/Support/helpers.php b/src/Support/helpers.php index cdda3ff10..b6251f7bd 100644 --- a/src/Support/helpers.php +++ b/src/Support/helpers.php @@ -65,6 +65,18 @@ function array_merge_alternate(array $original, array $override) return $original; } +/** + * Polyfill for the array_is_list function introduced in PHP 8.1. + * + * @param array $array The array to check. + * @return bool Returns true if the array is a list, false otherwise. + */ +function array_is_list(array $array): bool +{ + $keys = array_keys($array); + return $keys === array_keys($keys); +} + /** * Determines if the given string contains the given value. */ diff --git a/tests/legacy/recipe/named_arguments.php b/tests/legacy/recipe/named_arguments.php index 204412185..f0280e916 100644 --- a/tests/legacy/recipe/named_arguments.php +++ b/tests/legacy/recipe/named_arguments.php @@ -1,4 +1,4 @@ -= 8.0 namespace Deployer;