Skip to content

Commit

Permalink
Handle possibly null $arg_type
Browse files Browse the repository at this point in the history
  • Loading branch information
cgocast committed Sep 28, 2023
1 parent 55843b5 commit d9400ba
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,9 @@ private static function handleFetch(MethodReturnTypeProviderEvent $event): ?Unio
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;
$arg_type = $source->getNodeTypeProvider()->getType($call_arg->value);
if (isset($arg_type) && $arg_type->isSingleIntLiteral()) {
$fetch_mode = $arg_type->getSingleIntLiteral()->value;
}
break;
}
Expand Down

0 comments on commit d9400ba

Please sign in to comment.