1
0
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:
Matthew Brown 2019-05-26 16:26:47 -04:00
parent d51ee033ce
commit 69150d503a
2 changed files with 3 additions and 3 deletions

View File

@ -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

View File

@ -391,7 +391,7 @@ class ClassTest extends TestCase
if (class_exists($s) || interface_exists($s)) {}
}'
],
'SKIPPED-classExistsWithFalseArg' => [
'classExistsWithFalseArg' => [
'<?php
/**
* @param class-string $class