Skip to content

Commit ed5a6d1

Browse files
committed
Update QueryBuilderDqlRule.php
1 parent 8749a00 commit ed5a6d1

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

src/Rules/Doctrine/ORM/QueryBuilderDqlRule.php

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ public function processNode(Node $node, Scope $scope): array
5858
if (count($queryBuilderTypes) === 0) {
5959
if (
6060
$this->reportDynamicQueryBuilders
61-
&& (new ObjectType('Doctrine\ORM\QueryBuilder'))->isSuperTypeOf($calledOnType)->yes() && true
61+
&& (new ObjectType('Doctrine\ORM\QueryBuilder'))->isSuperTypeOf($calledOnType)->yes()
6262
) {
6363
return [
6464
RuleErrorBuilder::message('Could not analyse QueryBuilder with unknown beginning.')
@@ -69,6 +69,15 @@ public function processNode(Node $node, Scope $scope): array
6969
return [];
7070
}
7171

72+
// testing stuff
73+
$obj = (new ObjectType('Doctrine\ORM\QueryBuilder'))->isSuperTypeOf($calledOnType);
74+
if ($obj->yes()) {
75+
$x = 1;
76+
} else {
77+
$x = 2;
78+
}
79+
80+
7281
try {
7382
$dqlType = $scope->getType(new MethodCall($node, new Node\Identifier('getDQL'), []));
7483
} catch (Throwable $e) {

0 commit comments

Comments
 (0)