Skip to content

Commit bbf4512

Browse files
Add compatibility with phpstan 0.12.26 (#130)
1 parent 0c055c2 commit bbf4512

File tree

3 files changed

+7
-3
lines changed

3 files changed

+7
-3
lines changed

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
"require": {
2020
"php": "^7.1",
2121
"nikic/php-parser": "^4.4",
22-
"phpstan/phpstan": "^0.12.25"
22+
"phpstan/phpstan": "^0.12.26"
2323
},
2424
"require-dev": {
2525
"nette/utils": "^3.0",

tests/src/RuleTestCase.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
use PHPStan\PhpDoc\TypeNodeResolverExtension;
2323
use PHPStan\PhpDocParser\Lexer\Lexer;
2424
use PHPStan\PhpDocParser\Parser\PhpDocParser;
25+
use PHPStan\Reflection\ReflectionProvider\DirectReflectionProviderProvider;
2526
use PHPStan\Rules\Registry;
2627
use PHPStan\Rules\Rule;
2728
use PHPStan\Testing\TestCase;
@@ -90,6 +91,7 @@ private function getAnalyser(): Analyser
9091
);
9192

9293
$fileTypeMapper = new FileTypeMapper(
94+
new DirectReflectionProviderProvider($broker),
9395
$this->getParser(),
9496
self::getContainer()->getByType(PhpDocStringResolver::class),
9597
self::getContainer()->getByType(PhpDocNodeResolver::class),
@@ -100,6 +102,8 @@ private function getAnalyser(): Analyser
100102

101103
$nodeScopeResolver = new NodeScopeResolver(
102104
$broker,
105+
self::getReflectors()[0],
106+
$this->getClassReflectionExtensionRegistryProvider(),
103107
$this->getParser(),
104108
$fileTypeMapper,
105109
$phpDocInheritanceResolver,

tests/src/Rules/ThrowsPhpDocRuleTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
use Pepakriz\PHPStanExceptionRules\Rules\UnusedCatches\FooException;
1212
use Pepakriz\PHPStanExceptionRules\Rules\UnusedCatches\UnusedCatches;
1313
use Pepakriz\PHPStanExceptionRules\RuleTestCase;
14-
use PharData;
14+
use Phar;
1515
use PHPStan\Rules\Rule;
1616
use PHPUnit\Framework\TestCase;
1717
use ReflectionException;
@@ -107,7 +107,7 @@ public function testUnusedThrows(): void
107107
public function testUnusedCatches(): void
108108
{
109109
$this->methodThrowTypes = [
110-
PharData::class => [
110+
Phar::class => [
111111
'extractTo' => [
112112
RuntimeException::class,
113113
],

0 commit comments

Comments
 (0)