Skip to content
Permalink
Browse files

Workaround for uncaught InvalidArgumentException (#2420)

Fixes #2419
  • Loading branch information
TysonAndre authored and muglug committed Dec 5, 2019
1 parent 4548fb8 commit 6b2c1401c84c6af3ea5e634972fc696e1b7cd40d
@@ -14,6 +14,7 @@
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 @@ public static function analyze(
$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) {

0 comments on commit 6b2c140

Please sign in to comment.
You can’t perform that action at this time.