From 08aa3c15259af9ad428dedc0c61c17413f2465a3 Mon Sep 17 00:00:00 2001 From: Dominic Tubach Date: Tue, 1 Oct 2024 15:07:53 +0200 Subject: [PATCH] chore: Update phpcs, phpstan, and phpunit related files --- .github/workflows/phpcs.yml | 2 +- composer.json | 2 +- phpstan.neon.dist | 3 ++- phpunit.xml.dist | 23 +++++++++++++---------- tests/docker-compose.yml | 1 - tests/phpunit/bootstrap.php | 31 ++++++++++++++++++++++++++++--- tools/phpstan/composer.json | 2 +- 7 files changed, 46 insertions(+), 18 deletions(-) diff --git a/.github/workflows/phpcs.yml b/.github/workflows/phpcs.yml index 395cf22..a8c4a2d 100644 --- a/.github/workflows/phpcs.yml +++ b/.github/workflows/phpcs.yml @@ -18,7 +18,7 @@ jobs: - name: Setup PHP uses: shivammathur/setup-php@v2 with: - php-version: 8.1 + php-version: 8.3 coverage: none tools: cs2pr env: diff --git a/composer.json b/composer.json index b3f89da..5a40daa 100644 --- a/composer.json +++ b/composer.json @@ -43,7 +43,7 @@ "@php tools/phpcs/vendor/bin/phpcbf" ], "phpstan": [ - "@php tools/phpstan/vendor/bin/phpstan" + "@php tools/phpstan/vendor/bin/phpstan -v" ], "phpunit": [ "@php tools/phpunit/vendor/bin/simple-phpunit --coverage-text" diff --git a/phpstan.neon.dist b/phpstan.neon.dist index 9916d5d..509a442 100644 --- a/phpstan.neon.dist +++ b/phpstan.neon.dist @@ -27,7 +27,6 @@ parameters: checkTooWideReturnTypesInProtectedAndPublicMethods: true checkUninitializedProperties: true checkMissingCallableSignature: true - checkGenericClassInNonGenericObjectType: false treatPhpDocTypesAsCertain: false exceptions: check: @@ -39,6 +38,8 @@ parameters: ignoreErrors: # Note paths are prefixed with "*/" to work with inspections in PHPStorm because of: # https://youtrack.jetbrains.com/issue/WI-63891/PHPStan-ignoreErrors-configuration-isnt-working-with-inspections + - + identifier: missingType.generics - '#^Method Civi\\RemoteTools\\Api4\\Action\\[^\s]+Action::getHandlerResult\(\) has Civi\\RemoteTools\\Exception\\ActionHandlerNotFoundException in PHPDoc @throws tag but it.s not thrown.$#' - '#^Method Civi\\RemoteTools\\Api4\\Api4::createAction\(\) should return Civi\\Api4\\Generic\\AbstractAction but returns array|Civi\Api4\Generic\AbstractAction.$#' diff --git a/phpunit.xml.dist b/phpunit.xml.dist index f45c0c8..3c70cc2 100644 --- a/phpunit.xml.dist +++ b/phpunit.xml.dist @@ -1,6 +1,6 @@ - + - + ./tests/phpunit - - + + + api CRM Civi - - CRM/Remotetools/DAO - - - + + + CRM/Remotetools/DAO + + + + diff --git a/tests/docker-compose.yml b/tests/docker-compose.yml index bcbdd6c..0ac774f 100644 --- a/tests/docker-compose.yml +++ b/tests/docker-compose.yml @@ -1,4 +1,3 @@ -version: "3" services: civicrm: image: michaelmcandrew/civicrm:${CIVICRM_IMAGE_TAG:-5-drupal} diff --git a/tests/phpunit/bootstrap.php b/tests/phpunit/bootstrap.php index b304b0c..3380915 100644 --- a/tests/phpunit/bootstrap.php +++ b/tests/phpunit/bootstrap.php @@ -1,4 +1,5 @@