Skip to content

Commit

Permalink
ci: use PHP 8.1, 8.2, and 8.3 for doing syntax check
Browse files Browse the repository at this point in the history
  • Loading branch information
JohnVillalovos committed May 30, 2024
1 parent a27ce5b commit 4d6aae1
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 10 deletions.
23 changes: 13 additions & 10 deletions .github/workflows/lint-and-analyse-php.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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
Expand Down
25 changes: 25 additions & 0 deletions rector.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<?php
declare(strict_types=1);
use Rector\Config\RectorConfig;
use Rector\TypeDeclaration\Rector\ClassMethod\AddVoidReturnTypeWhereNoReturnRector;
return RectorConfig::configure()
->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,
]);

0 comments on commit 4d6aae1

Please sign in to comment.