From 843f14d069d12a121a79a385510d5b2c8aef01fb Mon Sep 17 00:00:00 2001 From: NikolayZhebet Date: Thu, 30 Sep 2021 20:09:15 +0300 Subject: [PATCH] fix 'Undefined offset: 1' in CodeBase::getTypeContextAtPosition issue (#6559) --- src/Psalm/Codebase.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Psalm/Codebase.php b/src/Psalm/Codebase.php index 256f5c5f1..894ea7eb3 100644 --- a/src/Psalm/Codebase.php +++ b/src/Psalm/Codebase.php @@ -1466,7 +1466,7 @@ class Codebase } // First parameter to a function-like $function_storage = $this->getFunctionStorageForSymbol($file_path, $function . '()'); - if (!$function_storage || !$function_storage->params) { + if (!$function_storage || !$function_storage->params || !isset($function_storage->params[$argument_num])) { return null; }