diff --git a/src/EventHandler/Iter/Count/FunctionReturnTypeProvider.php b/src/EventHandler/Iter/Count/FunctionReturnTypeProvider.php index e020de7..9ff45a4 100644 --- a/src/EventHandler/Iter/Count/FunctionReturnTypeProvider.php +++ b/src/EventHandler/Iter/Count/FunctionReturnTypeProvider.php @@ -68,8 +68,10 @@ public static function getFunctionReturnType(FunctionReturnTypeProviderEvent $ev return Type::getInt(); } - if (($array_argument_type instanceof Type\Atomic\TArray) && $array_argument_type->type_params[0]->isNever() && $array_argument_type->type_params[1]->isNever()) { - return Type::getInt(false, 0); + if ($array_argument_type instanceof Type\Atomic\TArray) { + if ($array_argument_type->type_params[0]->isNever() && $array_argument_type->type_params[1]->isNever()) { + return Type::getInt(false, 0); + } } return Type::getInt();