Skip to content

Commit 71bcd7d

Browse files
committed
Revert "Fix empty DQL with QueryBuilder::setParameters()"
This reverts commit 92c2184.
1 parent 92c2184 commit 71bcd7d

File tree

3 files changed

+2
-16
lines changed

3 files changed

+2
-16
lines changed

src/Type/Doctrine/QueryBuilder/QueryBuilderMethodDynamicReturnTypeExtension.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ public function isMethodSupported(MethodReflection $methodReflection): bool
7979
if ($returnType instanceof MixedType) {
8080
return false;
8181
}
82-
return (new ObjectType($this->getClass()))->isSuperTypeOf($returnType)->yes();
82+
return $returnType->isSuperTypeOf(new ObjectType($this->getClass()))->yes();
8383
}
8484

8585
public function getTypeFromMethodCall(

src/Type/Doctrine/QueryBuilder/QueryBuilderTypeSpecifyingExtension.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ public function specifyTypes(MethodReflection $methodReflection, MethodCall $nod
6565
if ($returnType instanceof MixedType) {
6666
return new SpecifiedTypes([]);
6767
}
68-
if (!(new ObjectType($this->getClass()))->isSuperTypeOf($returnType)->yes()) {
68+
if (!$returnType->isSuperTypeOf(new ObjectType($this->getClass()))->yes()) {
6969
return new SpecifiedTypes([]);
7070
}
7171

tests/DoctrineIntegration/ORM/data/queryBuilder.php

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -54,18 +54,4 @@ public function dynamicQueryBuilder(string $entityClass): Query
5454
return $queryBuilder->getQuery();
5555
}
5656

57-
public function usingMethodThatReturnStatic(): ?MyEntity
58-
{
59-
$queryBuilder = $this->entityManager->createQueryBuilder();
60-
61-
$queryBuilder
62-
->select('e')
63-
->from(MyEntity::class, 'e')
64-
->where('e.id = :id')
65-
->setParameters([
66-
'id' => 123,
67-
]);
68-
69-
return $queryBuilder->getQuery()->getOneOrNullResult();
70-
}
7157
}

0 commit comments

Comments
 (0)