Skip to content

Commit a44f840

Browse files
committed
Downgrade phpunit to 7.x.x
1 parent e7c3b76 commit a44f840

File tree

3 files changed

+10
-4
lines changed

3 files changed

+10
-4
lines changed

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
"phpstan/phpstan-nette": "^0.11",
2424
"phpstan/phpstan-phpunit": "^0.11",
2525
"phpstan/phpstan-strict-rules": "^0.11",
26-
"phpunit/phpunit": "^8.0.4",
26+
"phpunit/phpunit": "^7.5.6",
2727
"slevomat/coding-standard": "^4.8.3",
2828
"squizlabs/php_codesniffer": "~3.4.0"
2929
},

phpstan.neon.dist

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,8 @@ parameters:
1515
reportUnusedCatchesOfUncheckedExceptions: true
1616
uncheckedExceptions:
1717
- LogicException
18-
- ReflectionException
1918
- PHPStan\ShouldNotHappenException
2019
- PHPUnit\Framework\Exception
21-
- PHPUnit\Framework\MockObject\RuntimeException
2220
- Nette\DI\MissingServiceException
2321
methodThrowTypeDeclarations:
2422
PHPStan\Broker\Broker:

src/ThrowsAnnotationReader.php

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
use PHPStan\PhpDocParser\Parser\PhpDocParser;
1313
use PHPStan\PhpDocParser\Parser\TokenIterator;
1414
use PHPStan\Reflection\MethodReflection;
15+
use ReflectionException;
1516
use ReflectionFunction;
1617
use function sprintf;
1718
use function strtolower;
@@ -92,7 +93,12 @@ public function readByReflection($reflection, Scope $scope): array
9293
*/
9394
private function parse($reflection, string $sourceFile, ?string $namespace = null): array
9495
{
95-
$docBlock = $this->getDocblock($reflection);
96+
try {
97+
$docBlock = $this->getDocblock($reflection);
98+
} catch (ReflectionException $exception) {
99+
return [];
100+
}
101+
96102
if ($docBlock === null) {
97103
return [];
98104
}
@@ -117,6 +123,8 @@ private function parse($reflection, string $sourceFile, ?string $namespace = nul
117123

118124
/**
119125
* @param \PHPStan\Reflection\FunctionReflection|\PHPStan\Reflection\MethodReflection $reflection
126+
*
127+
* @throws ReflectionException
120128
*/
121129
private function getDocblock($reflection): ?string
122130
{

0 commit comments

Comments
 (0)