From 5594d1c25f03307f6268fcb71cccf28eafc2113c Mon Sep 17 00:00:00 2001 From: Sukhwinder Dhillon Date: Mon, 19 Jun 2023 15:44:15 +0200 Subject: [PATCH] Github Actions: Add Phpstan --- .github/workflows/php.yml | 8 ++++++++ phpstan.neon | 18 ++++++++++++++++++ 2 files changed, 26 insertions(+) create mode 100644 phpstan.neon diff --git a/.github/workflows/php.yml b/.github/workflows/php.yml index 5b2cd96b2..445121670 100644 --- a/.github/workflows/php.yml +++ b/.github/workflows/php.yml @@ -32,6 +32,10 @@ jobs: - name: Setup dependencies run: composer require -n --no-progress overtrue/phplint + && git clone --single-branch --branch master https://github.com/Icinga/icingaweb2.git vendor/icingaweb2 + && git clone --single-branch --branch snapshot/nightly https://github.com/Icinga/icinga-php-library.git vendor/icinga-php-library + && git clone --single-branch --branch snapshot/nightly https://github.com/Icinga/icinga-php-thirdparty.git vendor/icinga-php-thirdparty + - name: PHP Lint if: success() || matrix.allow_failure @@ -41,6 +45,10 @@ jobs: if: success() || matrix.allow_failure run: phpcs -wps --colors + - name: PHPStan + uses: php-actions/phpstan@v3 + if: success() || matrix.allow_failure + test: name: Unit tests with php ${{ matrix.php }} on ${{ matrix.os }} runs-on: ${{ matrix.os }} diff --git a/phpstan.neon b/phpstan.neon new file mode 100644 index 000000000..16853eaf6 --- /dev/null +++ b/phpstan.neon @@ -0,0 +1,18 @@ +parameters: + level: max + + checkFunctionNameCase: true + checkMissingIterableValueType: true + checkInternalClassCaseSensitivity: true + checkDynamicProperties: true + + paths: + - application + - library + + scanDirectories: + - vendor + + universalObjectCratesClasses: + - ipl\Orm\Model + - Icinga\Web\View