From dc6e36fe2adcff80b6f36ed7f5a594627f75d619 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 | 9 +++++++++ 2 files changed, 17 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..e8519a8a3 --- /dev/null +++ b/phpstan.neon @@ -0,0 +1,9 @@ +parameters: + level: 1 + paths: + - application + - library + scanDirectories: + - vendor + ignoreErrors: + - '#Unsafe usage of new static\(\)#' \ No newline at end of file