1
0
mirror of https://github.com/danog/psalm.git synced 2024-11-27 04:45:20 +01:00

Workaround for uncaught InvalidArgumentException (#2420)

Fixes #2419
This commit is contained in:
Tyson Andre 2019-12-04 23:16:51 -05:00 committed by Matthew Brown
parent 4548fb87f7
commit 6b2c1401c8

View File

@ -14,6 +14,7 @@ use Psalm\Issue\DeprecatedClass;
use Psalm\Issue\DeprecatedConstant;
use Psalm\Issue\InaccessibleClassConstant;
use Psalm\Issue\ParentNotFound;
use Psalm\Issue\UndefinedClass;
use Psalm\Issue\UndefinedConstant;
use Psalm\IssueBuffer;
use Psalm\Type;
@ -197,12 +198,16 @@ class ClassConstFetchAnalyzer
$class_visibility = \ReflectionProperty::IS_PUBLIC;
}
$class_constant_type = $codebase->classlikes->getConstantForClass(
$fq_class_name,
$stmt->name->name,
$class_visibility,
$statements_analyzer
);
try {
$class_constant_type = $codebase->classlikes->getConstantForClass(
$fq_class_name,
$stmt->name->name,
$class_visibility,
$statements_analyzer
);
} catch (\InvalidArgumentException $_) {
return;
}
if (!$class_constant_type) {
if ($fq_class_name !== $context->self) {