We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent a9eae20 commit 44275d6Copy full SHA for 44275d6
src/Type/Doctrine/QueryBuilder/QueryBuilderGetQueryDynamicReturnTypeExtension.php
@@ -23,6 +23,7 @@
23
use PHPStan\Type\DynamicMethodReturnTypeExtension;
24
use PHPStan\Type\Type;
25
use PHPStan\Type\TypeCombinator;
26
+use Throwable;
27
use function count;
28
use function in_array;
29
use function method_exists;
@@ -141,7 +142,11 @@ public function getTypeFromMethodCall(
141
142
return $defaultReturnType;
143
}
144
- $queryBuilder->{$methodName}(...$args);
145
+ try {
146
+ $queryBuilder->{$methodName}(...$args);
147
+ } catch (Throwable $e) {
148
+ return $defaultReturnType;
149
+ }
150
151
152
$resultTypes[] = $this->getQueryType($queryBuilder->getDQL());
0 commit comments