Skip to content

Commit

Permalink
Fixed parent class of ParseError on PHP < 7.3
Browse files Browse the repository at this point in the history
  • Loading branch information
ondrejmirtes committed Aug 2, 2020
1 parent 535c0e2 commit 353cb01
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 1 deletion.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
"nette/utils": "dev-master as 3.1.99",
"nikic/php-parser": "4.7.0",
"ondram/ci-detector": "^3.4.0",
"ondrejmirtes/better-reflection": "4.3.20",
"ondrejmirtes/better-reflection": "4.3.21",
"phpdocumentor/reflection-docblock": "4.3.4",
"phpstan/phpdoc-parser": "^0.4.8",
"react/child-process": "^0.6.1",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,4 +45,9 @@ public function testClassExists(): void
$this->analyse([__DIR__ . '/data/class-exists.php'], []);
}

public function testBug3690(): void
{
$this->analyse([__DIR__ . '/data/bug-3690.php'], []);
}

}
18 changes: 18 additions & 0 deletions tests/PHPStan/Rules/Exceptions/data/bug-3690.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<?php declare(strict_types = 1);

namespace Bug3690;

class HelloWorld
{
public function sayHello(): bool
{
try
{
return eval('');
}
catch (\ParseError $e)
{
return false;
}
}
}

0 comments on commit 353cb01

Please sign in to comment.