mirror of
https://github.com/danog/psalm.git
synced 2025-01-21 21:31:13 +01:00
Fix #1682 - correct arg check
This commit is contained in:
parent
d51ee033ce
commit
69150d503a
@ -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
|
||||
|
@ -391,7 +391,7 @@ class ClassTest extends TestCase
|
||||
if (class_exists($s) || interface_exists($s)) {}
|
||||
}'
|
||||
],
|
||||
'SKIPPED-classExistsWithFalseArg' => [
|
||||
'classExistsWithFalseArg' => [
|
||||
'<?php
|
||||
/**
|
||||
* @param class-string $class
|
||||
|
Loading…
x
Reference in New Issue
Block a user