From 2aa4a21e5e5ddce7dc3f4617ee19e302a922d926 Mon Sep 17 00:00:00 2001 From: Sukhwinder Dhillon Date: Tue, 21 Nov 2023 15:54:27 +0100 Subject: [PATCH] phpstan: Streamline vendor file location with local dev-env - Remove superfluous dir and composer requires --- .github/workflows/php.yml | 15 ++++++++------- phpstan.neon | 7 +++++-- 2 files changed, 13 insertions(+), 9 deletions(-) diff --git a/.github/workflows/php.yml b/.github/workflows/php.yml index b27c01c7..02f1fc98 100644 --- a/.github/workflows/php.yml +++ b/.github/workflows/php.yml @@ -32,15 +32,16 @@ jobs: - name: Setup dependencies run: | - composer require -n --no-progress overtrue/phplint phpunit/phpunit ipl/stdlib:@dev ipl/html:@dev - git clone --depth 1 https://github.com/Icinga/icingaweb2.git vendor/icingaweb2 - git clone --depth 1 -b snapshot/nightly https://github.com/Icinga/icinga-php-thirdparty.git vendor/icinga-php-thirdparty - git clone --depth 1 https://github.com/Icinga/icingaweb2-module-cube.git vendor/cube + composer require -n --no-progress overtrue/phplint phpunit/phpunit phpstan/phpstan + sudo git clone --depth 1 https://github.com/Icinga/icingaweb2.git /icingaweb2 + sudo git clone --depth 1 -b snapshot/nightly https://github.com/Icinga/icinga-php-thirdparty.git /usr/share/icinga-php/vendor + sudo git clone --depth 1 -b snapshot/nightly https://github.com/Icinga/icinga-php-library.git /usr/share/icinga-php/ipl + sudo git clone --depth 1 https://github.com/Icinga/icingaweb2-module-cube.git /usr/share/icingaweb2-modules/cube - name: Setup Incubator run: | - git clone --depth 1 https://github.com/Icinga/icingaweb2-module-incubator vendor/incubator - cd vendor/incubator + sudo git clone --depth 1 https://github.com/Icinga/icingaweb2-module-incubator /usr/share/icingaweb2-modules/incubator + cd /usr/share/icingaweb2-modules/incubator composer require --no-update \ "gipfl/calendar": "dev-master as 99.x-dev" \ "gipfl/cli": "dev-master as 99.x-dev" \ @@ -82,7 +83,7 @@ jobs: - name: PHPStan if: ${{ ! cancelled() }} - uses: php-actions/phpstan@v3 + run: ./vendor/bin/phpstan analyse test: name: Unit tests with php ${{ matrix.php }} on ${{ matrix.os }} diff --git a/phpstan.neon b/phpstan.neon index a3df34c0..1db016e6 100644 --- a/phpstan.neon +++ b/phpstan.neon @@ -17,8 +17,11 @@ parameters: - '#. but return statement is missing#' scanDirectories: - - vendor - - library/Director/Test + - /icingaweb2 + - /usr/share/icinga-php + - /usr/share/icingaweb2-modules/incubator + - /usr/share/icingaweb2-modules/cube + excludePaths: - library/Director/CoreBeta