diff --git a/.github/workflows/php.yml b/.github/workflows/php.yml index 87bdafb..7493428 100644 --- a/.github/workflows/php.yml +++ b/.github/workflows/php.yml @@ -17,7 +17,7 @@ jobs: strategy: fail-fast: false matrix: - php: ['7.2', '7.3', '7.4', '8.0', '8.1', '8.2'] + php: ['7.2', '7.3', '7.4', '8.0', '8.1', '8.2', '8.3'] os: ['ubuntu-latest'] steps: @@ -32,11 +32,12 @@ jobs: - name: Setup dependencies run: | - composer require -n --no-progress overtrue/phplint - git clone --depth 1 https://github.com/Icinga/icingaweb2.git vendor/icingaweb2 - git clone --depth 1 https://github.com/Icinga/icingadb-web.git vendor/modules/icingadb-web - git clone --depth 1 -b snapshot/nightly https://github.com/Icinga/icinga-php-library.git vendor/icinga-php-library - git clone --depth 1 -b snapshot/nightly https://github.com/Icinga/icinga-php-thirdparty.git vendor/icinga-php-thirdparty + composer require -n --no-progress overtrue/phplint phpstan/phpstan + 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 -b snapshot/nightly https://github.com/Icinga/icinga-php-thirdparty.git /usr/share/icinga-php/vendor + sudo git clone --depth 1 https://github.com/Icinga/icingaweb2.git /icingaweb2 + sudo git clone --depth 1 https://github.com/Icinga/icingadb-web.git /usr/share/icingaweb2-modules/icingadb + - name: PHP Lint if: ${{ ! cancelled() }} @@ -48,4 +49,4 @@ jobs: - name: PHPStan if: ${{ ! cancelled() }} - uses: php-actions/phpstan@v3 + run: ./vendor/bin/phpstan analyse diff --git a/phpstan-baseline-7x.neon b/phpstan-baseline-7x.neon new file mode 100644 index 0000000..6e4c763 --- /dev/null +++ b/phpstan-baseline-7x.neon @@ -0,0 +1,16 @@ +parameters: + ignoreErrors: + - + message: "#^Method Icinga\\\\Module\\\\Cube\\\\Ido\\\\IdoHostStatusCube\\:\\:listAvailableDimensions\\(\\) should return array but returns array\\\\|false\\.$#" + count: 1 + path: library/Cube/Ido/IdoHostStatusCube.php + + - + message: "#^Method Icinga\\\\Module\\\\Cube\\\\Ido\\\\IdoServiceStatusCube\\:\\:listAvailableDimensions\\(\\) should return array but returns array\\\\|false\\.$#" + count: 1 + path: library/Cube/Ido/IdoServiceStatusCube.php + + - + message: "#^Parameter \\#1 \\$function of function call_user_func_array expects callable\\(\\)\\: mixed, array\\{Zend_Db_Select, string\\} given\\.$#" + count: 1 + path: library/Cube/Ido/ZfSelectWrapper.php diff --git a/phpstan-baseline-8x.neon b/phpstan-baseline-8x.neon new file mode 100644 index 0000000..7ea3ac5 --- /dev/null +++ b/phpstan-baseline-8x.neon @@ -0,0 +1,6 @@ +parameters: + ignoreErrors: + - + message: "#^Parameter \\#1 \\$callback of function call_user_func_array expects callable\\(\\)\\: mixed, array\\{Zend_Db_Select, string\\} given\\.$#" + count: 1 + path: library/Cube/Ido/ZfSelectWrapper.php diff --git a/phpstan-baseline-by-php-version.php b/phpstan-baseline-by-php-version.php new file mode 100644 index 0000000..05107df --- /dev/null +++ b/phpstan-baseline-by-php-version.php @@ -0,0 +1,12 @@ + $includes +]; diff --git a/phpstan-baseline.neon b/phpstan-baseline-standard.neon similarity index 99% rename from phpstan-baseline.neon rename to phpstan-baseline-standard.neon index 0c37e72..6a78bcf 100644 --- a/phpstan-baseline.neon +++ b/phpstan-baseline-standard.neon @@ -860,11 +860,6 @@ parameters: count: 1 path: library/Cube/Ido/IdoCube.php - - - message: "#^Cannot access offset 'host'\\|'service' on array\\|stdClass\\.$#" - count: 1 - path: library/Cube/Ido/IdoCube.php - - message: "#^Cannot call method getDbAdapter\\(\\) on mixed\\.$#" count: 1 @@ -990,11 +985,6 @@ parameters: count: 1 path: library/Cube/Ido/ZfSelectWrapper.php - - - message: "#^Parameter \\#1 \\$callback of function call_user_func_array expects callable\\(\\)\\: mixed, array\\{Zend_Db_Select, string\\} given\\.$#" - count: 1 - path: library/Cube/Ido/ZfSelectWrapper.php - - message: "#^Parameter \\#1 \\$rule of method ipl\\\\Stdlib\\\\Filter\\\\Chain\\:\\:add\\(\\) expects ipl\\\\Stdlib\\\\Filter\\\\Rule, ipl\\\\Stdlib\\\\Filter\\\\Rule\\|null given\\.$#" count: 1 diff --git a/phpstan.neon b/phpstan.neon index 82abfa0..27fce80 100644 --- a/phpstan.neon +++ b/phpstan.neon @@ -1,5 +1,6 @@ includes: - - phpstan-baseline.neon + - phpstan-baseline-standard.neon + - phpstan-baseline-by-php-version.php parameters: level: max @@ -13,7 +14,9 @@ parameters: - library scanDirectories: - - vendor + - /icingaweb2 + - /usr/share/icinga-php + - /usr/share/icingaweb2-modules ignoreErrors: -