Skip to content

Commit

Permalink
Updated to phpstan2
Browse files Browse the repository at this point in the history
  • Loading branch information
fballiano committed Nov 11, 2024
1 parent 008e121 commit 71dbdaa
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/Type/Mage/MethodReturnTypeDetector.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,16 +42,17 @@ public function getTypeFromMethodCall(MethodReflection $methodReflection, Method
protected function getTypeFromExpr(MethodReflection $methodReflection, $methodCall, Scope $scope): Type
{
$argument = $methodCall->getArgs()[0] ?? null;
if ($argument === null || ! $argument->value instanceof String_) {
return ParametersAcceptorSelector::selectFromArgs(
if ($argument === null || !$argument->value instanceof String_) {
$variant = ParametersAcceptorSelector::selectFromArgs(
$scope,
$methodCall->getArgs(),
$methodReflection->getVariants());
$methodReflection->getVariants()
);
return $variant->getReturnType();
}

$modelName = $argument->value->value;
$modelClassName = $this->getMagentoClassName($modelName);

return new ObjectType($modelClassName);
}

Expand Down

0 comments on commit 71dbdaa

Please sign in to comment.