Skip to content

Commit

Permalink
Fix call with no class yet
Browse files Browse the repository at this point in the history
  • Loading branch information
alexander-schranz committed Feb 10, 2025
1 parent 8642383 commit 34c99d9
Showing 1 changed file with 6 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -70,20 +70,19 @@ public function getTypeFromMethodCall(
$argumentType = $scope->getType($args[0]->value);

$templateObjectType = $calledOnType->getTemplateType(Prophecy\ObjectProphecy::class, 'T');
$classObjectType = $argumentType->getClassStringObjectType();

if ($templateObjectType->isObject()->no()) {
return $returnType;
$objects = [];
if ($templateObjectType->isObject()->no()
|| \count($templateObjectType->getObjectClassNames()) !== 0) {
$objects[] = $templateObjectType;
}

$classObjectType = $argumentType->getClassStringObjectType();

if ($classObjectType->isObject()->no()) {
return $returnType;
}

$objects = [];
if (\count($templateObjectType->getObjectClassNames()) !== 0) {
$objects[] = $templateObjectType;
}
$objects[] = $classObjectType;

return new Type\Generic\GenericObjectType(
Expand Down

0 comments on commit 34c99d9

Please sign in to comment.