Skip to content

Commit

Permalink
Handle positional argument
Browse files Browse the repository at this point in the history
  • Loading branch information
cgocast committed Sep 28, 2023
1 parent 2217f5e commit 55843b5
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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()) {

Check failure on line 57 in src/Psalm/Internal/Provider/ReturnTypeProvider/PdoStatementReturnTypeProvider.php

View workflow job for this annotation

GitHub Actions / build

PossiblyNullReference

src/Psalm/Internal/Provider/ReturnTypeProvider/PdoStatementReturnTypeProvider.php:57:38: PossiblyNullReference: Cannot call method isSingleIntLiteral on possibly null value (see https://psalm.dev/083)
$fetch_mode = $first_arg_type->getSingleIntLiteral()->value;
Expand Down

0 comments on commit 55843b5

Please sign in to comment.