diff --git a/.github/dependabot.yml b/.github/dependabot.yml index ac5420e..4ea27ae 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -14,6 +14,7 @@ updates: - dependency-type: "development" ignore: - dependency-name: "phpunit/phpunit" + - dependency-name: "composer-runtime-api" groups: phpstan: patterns: ["*phpstan*"] diff --git a/composer.json b/composer.json index 1b90439..dc7a1b9 100644 --- a/composer.json +++ b/composer.json @@ -25,12 +25,14 @@ }, "require-dev": { "phpunit/phpunit": "^8.5.21 || ^9.5.10", - "phpstan/phpstan-strict-rules": "1.5.1", - "spaze/phpstan-disallowed-calls": "2.16.0", - "shipmonk/phpstan-rules": "2.7.0", - "phpstan/phpstan-phpunit": "1.3.14", + "phpstan/phpstan-strict-rules": "1.5.2", + "spaze/phpstan-disallowed-calls": "2.16.1", + "shipmonk/phpstan-rules": "2.9.2", + "phpstan/phpstan-phpunit": "1.3.15", "php-parallel-lint/php-parallel-lint": "1.3.2", - "nepada/coding-standard": "7.11.0" + "nepada/coding-standard": "7.11.0", + "composer-runtime-api": "^2.0", + "composer/semver": "3.4.0" }, "autoload": { "psr-4": { diff --git a/phpstan.tests.neon.dist b/phpstan.tests.neon.dist index 54f63a2..1f7ced2 100644 --- a/phpstan.tests.neon.dist +++ b/phpstan.tests.neon.dist @@ -9,6 +9,7 @@ includes: - vendor/spaze/phpstan-disallowed-calls/disallowed-loose-calls.neon - tests/PHPStan/disallowedCalls.neon - tests/PHPStan/shipmonk.neon + - tests/PHPStan/conditional.config.tests.php parameters: level: max diff --git a/tests/MessageBus/CatchWithUnthrownExceptionRuleTest.php b/tests/MessageBus/CatchWithUnthrownExceptionRuleTest.php index f589e8b..2390b2b 100644 --- a/tests/MessageBus/CatchWithUnthrownExceptionRuleTest.php +++ b/tests/MessageBus/CatchWithUnthrownExceptionRuleTest.php @@ -4,6 +4,7 @@ namespace NepadaTests\PHPStan\MessageBus; use PHPStan\Rules\Exceptions\CatchWithUnthrownExceptionRule; +use PHPStan\Rules\Exceptions\DefaultExceptionTypeResolver; use PHPStan\Rules\Rule; /** @@ -14,7 +15,16 @@ class CatchWithUnthrownExceptionRuleTest extends DynamicExtensionsRuleTestCase protected function getRule(): Rule { - return new CatchWithUnthrownExceptionRule(); + return new CatchWithUnthrownExceptionRule( + new DefaultExceptionTypeResolver( + $this->createReflectionProvider(), + [], + [], + [], + [], + ), + true + ); } public function testRule(): void diff --git a/tests/PHPStan/conditional.config.tests.php b/tests/PHPStan/conditional.config.tests.php new file mode 100644 index 0000000..450c91e --- /dev/null +++ b/tests/PHPStan/conditional.config.tests.php @@ -0,0 +1,17 @@ + '~^Class PHPStan\\\\Rules\\\\Exceptions\\\\CatchWithUnthrownExceptionRule does not have a constructor and must be instantiated without any parameters\\.$~', + 'path' => '../../tests/MessageBus/CatchWithUnthrownExceptionRuleTest.php', + 'count' => 1, + ]; +} + +return $config;