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:
3939 - 'PHPStan\ShouldNotHappenException'
4040 - 'Symfony\Component\Console\Exception\InvalidArgumentException'
4141 - 'PHPStan\BetterReflection\SourceLocator\Exception\InvalidFileLocation'
42- - 'PHPStan\BetterReflection\SourceLocator\Exception\InvalidArgumentException'
4342 - 'Symfony\Component\Finder\Exception\DirectoryNotFoundException'
4443 - 'InvalidArgumentException'
4544 - 'PHPStan\DependencyInjection\ParameterNotFoundException'
Original file line number Diff line number Diff line change 55use Nette \Utils \Strings ;
66use PHPStan \Analyser \Scope ;
77use PHPStan \Reflection \ReflectionProvider ;
8+ use PHPStan \ShouldNotHappenException ;
89use function count ;
910
1011/**
@@ -27,6 +28,16 @@ public function __construct(
2728 private array $ checkedExceptionClasses ,
2829 )
2930 {
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+ }
3041 }
3142
3243 public function isCheckedException (string $ className , Scope $ scope ): bool
You can’t perform that action at this time.
0 commit comments