Skip to content

Commit e71ae27

Browse files
authored
Update ActiveQueryDynamicMethodReturnTypeExtension.php
Remove check of type for ActiveQuery objects
1 parent 2350d48 commit e71ae27

File tree

1 file changed

+0
-4
lines changed

1 file changed

+0
-4
lines changed

src/Type/ActiveQueryDynamicMethodReturnTypeExtension.php

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,10 +41,6 @@ public function isMethodSupported(MethodReflection $methodReflection): bool
4141
public function getTypeFromMethodCall(MethodReflection $methodReflection, MethodCall $methodCall, Scope $scope): Type
4242
{
4343
$calledOnType = $scope->getType($methodCall->var);
44-
if (!$calledOnType instanceof ActiveQueryObjectType) {
45-
throw new ShouldNotHappenException(sprintf('Unexpected type %s during method call %s at line %d', \get_class($calledOnType), $methodReflection->getName(), $methodCall->getLine()));
46-
}
47-
4844
$methodName = $methodReflection->getName();
4945
if ($methodName === 'asArray') {
5046
$argType = isset($methodCall->args[0]) && $methodCall->args[0] instanceof Arg ? $scope->getType($methodCall->args[0]->value) : new ConstantBooleanType(true);

0 commit comments

Comments
 (0)