Skip to content

Commit

Permalink
fix: check arg count in BuilderModelFindExtension
Browse files Browse the repository at this point in the history
fixes: #1452
  • Loading branch information
canvural committed Dec 9, 2022
1 parent ff18940 commit a5e8312
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/ReturnTypes/BuilderModelFindExtension.php
Expand Up @@ -81,7 +81,11 @@ public function getTypeFromMethodCall(
MethodReflection $methodReflection,
MethodCall $methodCall,
Scope $scope
): Type {
): ?Type {
if (count($methodCall->getArgs()) < 1) {
return null;
}

/** @var ObjectType $model */
$model = $methodReflection->getDeclaringClass()->getActiveTemplateTypeMap()->getType('TModelClass');
$returnType = $methodReflection->getVariants()[0]->getReturnType();
Expand Down

0 comments on commit a5e8312

Please sign in to comment.