mirror of
https://github.com/danog/psalm.git
synced 2024-12-02 17:52:45 +01:00
Fix include check and nest function arg check
This commit is contained in:
parent
55fc146c57
commit
24fd84617f
@ -2705,7 +2705,8 @@ class StatementsChecker
|
|||||||
$absolute_class = ($this->namespace ? $this->namespace . '\\' : '') . $this->class_name;
|
$absolute_class = ($this->namespace ? $this->namespace . '\\' : '') . $this->class_name;
|
||||||
}
|
}
|
||||||
|
|
||||||
} elseif ($this->check_classes) {
|
}
|
||||||
|
elseif ($this->check_classes) {
|
||||||
$does_class_exist = ClassLikeChecker::checkClassName($stmt->class, $this->namespace, $this->aliased_classes, $this->checked_file_name, $this->suppressed_issues);
|
$does_class_exist = ClassLikeChecker::checkClassName($stmt->class, $this->namespace, $this->aliased_classes, $this->checked_file_name, $this->suppressed_issues);
|
||||||
|
|
||||||
if (!$does_class_exist) {
|
if (!$does_class_exist) {
|
||||||
@ -3522,7 +3523,8 @@ class StatementsChecker
|
|||||||
|
|
||||||
$method_id = null;
|
$method_id = null;
|
||||||
|
|
||||||
if ($stmt->name instanceof PhpParser\Node\Name && $this->check_functions) {
|
if ($this->check_functions) {
|
||||||
|
if ($stmt->name instanceof PhpParser\Node\Name) {
|
||||||
$method_id = implode('', $stmt->name->parts);
|
$method_id = implode('', $stmt->name->parts);
|
||||||
|
|
||||||
if ($context->self) {
|
if ($context->self) {
|
||||||
@ -3537,6 +3539,7 @@ class StatementsChecker
|
|||||||
if ($this->checkFunctionArguments($stmt->args, $method_id, $context, $stmt->getLine()) === false) {
|
if ($this->checkFunctionArguments($stmt->args, $method_id, $context, $stmt->getLine()) === false) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if ($stmt->name instanceof PhpParser\Node\Name && $this->check_functions) {
|
if ($stmt->name instanceof PhpParser\Node\Name && $this->check_functions) {
|
||||||
$stmt->inferredType = FunctionChecker::getReturnTypeFromCallMap($method_id, $stmt->args);
|
$stmt->inferredType = FunctionChecker::getReturnTypeFromCallMap($method_id, $stmt->args);
|
||||||
@ -3755,7 +3758,7 @@ class StatementsChecker
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
$path_to_file = self::getPathTo($stmt->expr, $this->checked_file_name);
|
$path_to_file = self::getPathTo($stmt->expr, $this->include_file_name ?: $this->file_name);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($path_to_file) {
|
if ($path_to_file) {
|
||||||
|
Loading…
Reference in New Issue
Block a user