From 4d6aae1bbaccbb1cc044c8b540b641afa130f3e1 Mon Sep 17 00:00:00 2001 From: "John L. Villalovos" Date: Thu, 30 May 2024 16:54:43 -0700 Subject: [PATCH] ci: use PHP 8.1, 8.2, and 8.3 for doing syntax check --- .github/workflows/lint-and-analyse-php.yml | 23 +++++++++++--------- rector.php | 25 ++++++++++++++++++++++ 2 files changed, 38 insertions(+), 10 deletions(-) create mode 100644 rector.php diff --git a/.github/workflows/lint-and-analyse-php.yml b/.github/workflows/lint-and-analyse-php.yml index b9abd655d..b1b3e7eb8 100644 --- a/.github/workflows/lint-and-analyse-php.yml +++ b/.github/workflows/lint-and-analyse-php.yml @@ -21,7 +21,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - php-version: ["8.1"] + php-version: ["8.3"] steps: - name: Checkout code uses: actions/checkout@v4 @@ -35,13 +35,16 @@ jobs: # - name: Validate composer.json and composer.lock # run: composer validate --strict - - name: Install Composer dependencies + - name: Rector install # Allow the previous check to fail but not abort if: always() - uses: ramsey/composer-install@v2 - with: - # Ignore zip for php-webdriver/webdriver - composer-options: "--ignore-platform-req=ext-zip" + run: composer require rector/rector --dev + + - name: Run rector + # Allow the previous check to fail but not abort + if: always() + run: vendor/bin/rector process src --dry-run + # TODO: Enable this after resolving issues # - name: Cache coding-standard @@ -52,10 +55,10 @@ jobs: # path: .phpcs-cache # key: phpcs-cache - - name: Lint PHP files - # Allow the previous check to fail but not abort - if: always() - run: ./ci/ci-phplint + # - name: Lint PHP files + # # Allow the previous check to fail but not abort + # if: always() + # run: ./ci/ci-phplint # TODO: Enable this after resolving issues # - name: Check coding-standard diff --git a/rector.php b/rector.php new file mode 100644 index 000000000..b701056d0 --- /dev/null +++ b/rector.php @@ -0,0 +1,25 @@ +withPaths([ + __DIR__ . '/Controls', + __DIR__ . '/Domain', + __DIR__ . '/Jobs', + __DIR__ . '/Pages', + __DIR__ . '/Presenters', + __DIR__ . '/Web', + __DIR__ . '/WebServices', + __DIR__ . '/config', + __DIR__ . '/lang', + __DIR__ . '/lib', + __DIR__ . '/phing-tasks', + __DIR__ . '/plugins', + __DIR__ . '/tests', + ]) + // uncomment to reach your current PHP version + // ->withPhpSets() + ->withRules([ + AddVoidReturnTypeWhereNoReturnRector::class, + ]);