Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ updates:
- dependency-type: "development"
ignore:
- dependency-name: "phpunit/phpunit"
- dependency-name: "composer-runtime-api"
groups:
phpstan:
patterns: ["*phpstan*"]
12 changes: 7 additions & 5 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand Down
1 change: 1 addition & 0 deletions phpstan.tests.neon.dist
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
12 changes: 11 additions & 1 deletion tests/MessageBus/CatchWithUnthrownExceptionRuleTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
namespace NepadaTests\PHPStan\MessageBus;

use PHPStan\Rules\Exceptions\CatchWithUnthrownExceptionRule;
use PHPStan\Rules\Exceptions\DefaultExceptionTypeResolver;
use PHPStan\Rules\Rule;

/**
Expand All @@ -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
Expand Down
17 changes: 17 additions & 0 deletions tests/PHPStan/conditional.config.tests.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<?php
declare(strict_types = 1);

use Composer\InstalledVersions;
use Composer\Semver\VersionParser;

$config = [];

if (InstalledVersions::satisfies(new VersionParser(), 'phpstan/phpstan', '<1.10.36')) {
$config['parameters']['ignoreErrors'][] = [
'message' => '~^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;