From 55843b5ac80acf560942908f54847d9be536a2c4 Mon Sep 17 00:00:00 2001 From: cgocast Date: Thu, 28 Sep 2023 15:23:35 +0200 Subject: [PATCH] Handle positional argument --- .../ReturnTypeProvider/PdoStatementReturnTypeProvider.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Psalm/Internal/Provider/ReturnTypeProvider/PdoStatementReturnTypeProvider.php b/src/Psalm/Internal/Provider/ReturnTypeProvider/PdoStatementReturnTypeProvider.php index 03648afabd7..37a3f199954 100644 --- a/src/Psalm/Internal/Provider/ReturnTypeProvider/PdoStatementReturnTypeProvider.php +++ b/src/Psalm/Internal/Provider/ReturnTypeProvider/PdoStatementReturnTypeProvider.php @@ -50,9 +50,9 @@ private static function handleFetch(MethodReturnTypeProviderEvent $event): ?Unio $call_args = $event->getCallArgs(); $fetch_mode = 0; - foreach($call_args as $call_arg) { - $arg_name = $call_arg->name->name; - if (!isset($arg_name) || $arg_name === "mode") { + foreach ($call_args as $call_arg) { + $arg_name = $call_arg->name; + if (!isset($arg_name) || $arg_name->name === "mode") { $first_arg_type = $source->getNodeTypeProvider()->getType($call_arg->value); if ($first_arg_type->isSingleIntLiteral()) { $fetch_mode = $first_arg_type->getSingleIntLiteral()->value;