File tree Expand file tree Collapse file tree 2 files changed +11
-1
lines changed Expand file tree Collapse file tree 2 files changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -39,7 +39,6 @@ parameters:
39
39
- 'PHPStan\ShouldNotHappenException'
40
40
- 'Symfony\Component\Console\Exception\InvalidArgumentException'
41
41
- 'PHPStan\BetterReflection\SourceLocator\Exception\InvalidFileLocation'
42
- - 'PHPStan\BetterReflection\SourceLocator\Exception\InvalidArgumentException'
43
42
- 'Symfony\Component\Finder\Exception\DirectoryNotFoundException'
44
43
- 'InvalidArgumentException'
45
44
- 'PHPStan\DependencyInjection\ParameterNotFoundException'
Original file line number Diff line number Diff line change 5
5
use Nette \Utils \Strings ;
6
6
use PHPStan \Analyser \Scope ;
7
7
use PHPStan \Reflection \ReflectionProvider ;
8
+ use PHPStan \ShouldNotHappenException ;
8
9
use function count ;
9
10
10
11
/**
@@ -27,6 +28,16 @@ public function __construct(
27
28
private array $ checkedExceptionClasses ,
28
29
)
29
30
{
31
+ foreach ($ this ->checkedExceptionClasses as $ checkedExceptionClass ) {
32
+ if (!$ this ->reflectionProvider ->hasClass ($ checkedExceptionClass )) {
33
+ throw new ShouldNotHappenException ('Class ' . $ checkedExceptionClass . ' used in \'checkedExceptionClasses \' does not exist. ' );
34
+ }
35
+ }
36
+ foreach ($ this ->uncheckedExceptionClasses as $ uncheckedExceptionClass ) {
37
+ if (!$ this ->reflectionProvider ->hasClass ($ uncheckedExceptionClass )) {
38
+ throw new ShouldNotHappenException ('Class ' . $ uncheckedExceptionClass . ' used in \'uncheckedExceptionClasses \' does not exist. ' );
39
+ }
40
+ }
30
41
}
31
42
32
43
public function isCheckedException (string $ className , Scope $ scope ): bool
You can’t perform that action at this time.
0 commit comments