diff --git a/src/Psalm/Internal/Analyzer/Statements/Expression/AssertionFinder.php b/src/Psalm/Internal/Analyzer/Statements/Expression/AssertionFinder.php index f83203e7a..62dc691c7 100644 --- a/src/Psalm/Internal/Analyzer/Statements/Expression/AssertionFinder.php +++ b/src/Psalm/Internal/Analyzer/Statements/Expression/AssertionFinder.php @@ -2296,11 +2296,11 @@ class AssertionFinder if ($stmt->name instanceof PhpParser\Node\Name && strtolower($stmt->name->parts[0]) === 'class_exists' ) { - if (!isset($stmt->args[2])) { + if (!isset($stmt->args[1])) { return true; } - $second_arg = $stmt->args[2]->value; + $second_arg = $stmt->args[1]->value; if ($second_arg instanceof PhpParser\Node\Expr\ConstFetch && $second_arg->name instanceof PhpParser\Node\Name diff --git a/tests/ClassTest.php b/tests/ClassTest.php index 273ecd5f1..151266808 100644 --- a/tests/ClassTest.php +++ b/tests/ClassTest.php @@ -391,7 +391,7 @@ class ClassTest extends TestCase if (class_exists($s) || interface_exists($s)) {} }' ], - 'SKIPPED-classExistsWithFalseArg' => [ + 'classExistsWithFalseArg' => [ '