diff --git a/src/Psalm/Internal/Analyzer/ClassAnalyzer.php b/src/Psalm/Internal/Analyzer/ClassAnalyzer.php index 1ed32a93a..7dc8a012e 100644 --- a/src/Psalm/Internal/Analyzer/ClassAnalyzer.php +++ b/src/Psalm/Internal/Analyzer/ClassAnalyzer.php @@ -1713,7 +1713,7 @@ class ClassAnalyzer extends ClassLikeAnalyzer $template_params[] = new Type\Union([ new Type\Atomic\TTemplateParam( $param_name, - reset($template_map)[0], + \reset($template_map)[0], $key ) ]); diff --git a/src/Psalm/Internal/Analyzer/FunctionLikeAnalyzer.php b/src/Psalm/Internal/Analyzer/FunctionLikeAnalyzer.php index 0df25ed69..1da5936f6 100644 --- a/src/Psalm/Internal/Analyzer/FunctionLikeAnalyzer.php +++ b/src/Psalm/Internal/Analyzer/FunctionLikeAnalyzer.php @@ -189,7 +189,7 @@ abstract class FunctionLikeAnalyzer extends SourceAnalyzer implements Statements $template_params[] = new Type\Union([ new Type\Atomic\TTemplateParam( $param_name, - reset($template_map)[0], + \reset($template_map)[0], $key ) ]); diff --git a/src/Psalm/Internal/Analyzer/Statements/Expression/Assignment/ArrayAssignmentAnalyzer.php b/src/Psalm/Internal/Analyzer/Statements/Expression/Assignment/ArrayAssignmentAnalyzer.php index b61c75625..b83bdbdbb 100644 --- a/src/Psalm/Internal/Analyzer/Statements/Expression/Assignment/ArrayAssignmentAnalyzer.php +++ b/src/Psalm/Internal/Analyzer/Statements/Expression/Assignment/ArrayAssignmentAnalyzer.php @@ -602,7 +602,6 @@ class ArrayAssignmentAnalyzer // do nothing } } - } return null; diff --git a/src/Psalm/Internal/Analyzer/Statements/Expression/Call/MethodCallAnalyzer.php b/src/Psalm/Internal/Analyzer/Statements/Expression/Call/MethodCallAnalyzer.php index ab73af488..61e0d46ec 100644 --- a/src/Psalm/Internal/Analyzer/Statements/Expression/Call/MethodCallAnalyzer.php +++ b/src/Psalm/Internal/Analyzer/Statements/Expression/Call/MethodCallAnalyzer.php @@ -1553,8 +1553,9 @@ class MethodCallAnalyzer extends \Psalm\Internal\Analyzer\Statements\Expression\ $e = $calling_class_storage->template_type_extends; if ($lhs_type_part instanceof TGenericObject) { - if ($calling_class_storage->template_types && $class_storage === $calling_class_storage) { + if ($class_storage === $calling_class_storage && $calling_class_storage->template_types) { $i = 0; + foreach ($calling_class_storage->template_types as $type_name => $_) { if (isset($lhs_type_part->type_params[$i])) { $class_template_params[$type_name][$calling_class_storage->name] = [