Skip to content

Commit 353cb01

Browse files
committed
Fixed parent class of ParseError on PHP < 7.3
1 parent 535c0e2 commit 353cb01

File tree

3 files changed

+24
-1
lines changed

3 files changed

+24
-1
lines changed

composer.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
"nette/utils": "dev-master as 3.1.99",
2222
"nikic/php-parser": "4.7.0",
2323
"ondram/ci-detector": "^3.4.0",
24-
"ondrejmirtes/better-reflection": "4.3.20",
24+
"ondrejmirtes/better-reflection": "4.3.21",
2525
"phpdocumentor/reflection-docblock": "4.3.4",
2626
"phpstan/phpdoc-parser": "^0.4.8",
2727
"react/child-process": "^0.6.1",

tests/PHPStan/Rules/Exceptions/CaughtExceptionExistenceRuleTest.php

+5
Original file line numberDiff line numberDiff line change
@@ -45,4 +45,9 @@ public function testClassExists(): void
4545
$this->analyse([__DIR__ . '/data/class-exists.php'], []);
4646
}
4747

48+
public function testBug3690(): void
49+
{
50+
$this->analyse([__DIR__ . '/data/bug-3690.php'], []);
51+
}
52+
4853
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
<?php declare(strict_types = 1);
2+
3+
namespace Bug3690;
4+
5+
class HelloWorld
6+
{
7+
public function sayHello(): bool
8+
{
9+
try
10+
{
11+
return eval('');
12+
}
13+
catch (\ParseError $e)
14+
{
15+
return false;
16+
}
17+
}
18+
}

0 commit comments

Comments
 (0)