From 9cdcd6b969ffb2c408cff854a91e14dd5c80ac41 Mon Sep 17 00:00:00 2001 From: Sztig Date: Fri, 20 Mar 2026 13:03:44 +0100 Subject: [PATCH 1/3] extended possible params for countBy, findBy and findOneBy in GatewayInterface to be able to use Stringable --- src/contracts/Gateway/GatewayInterface.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/contracts/Gateway/GatewayInterface.php b/src/contracts/Gateway/GatewayInterface.php index 248ccde..21cfabd 100644 --- a/src/contracts/Gateway/GatewayInterface.php +++ b/src/contracts/Gateway/GatewayInterface.php @@ -23,7 +23,7 @@ public function getMetadata(): DoctrineSchemaMetadataInterface; public function countAll(): int; /** - * @param \Doctrine\Common\Collections\Expr\Expression|array<\Doctrine\Common\Collections\Expr\Expression|scalar|array> $criteria + * @param \Doctrine\Common\Collections\Expr\Expression|array|\Stringable|\Doctrine\Common\Collections\Expr\Expression> $criteria $criteria */ public function countBy($criteria): int; @@ -33,7 +33,7 @@ public function countBy($criteria): int; public function findAll(?int $limit = null, int $offset = 0): array; /** - * @param \Doctrine\Common\Collections\Expr\Expression|array<\Doctrine\Common\Collections\Expr\Expression|scalar|array|null> $criteria Map of column names to values that will be used as part of WHERE query + * @param \Doctrine\Common\Collections\Expr\Expression|array|\Stringable|\Doctrine\Common\Collections\Expr\Expression> $criteria Map of column names to values that will be used as part of WHERE query * @param array|null $orderBy Map of column names to "ASC" or "DESC", that will be used in SORT query * * @phpstan-param array|null $orderBy @@ -43,7 +43,7 @@ public function findAll(?int $limit = null, int $offset = 0): array; public function findBy($criteria, ?array $orderBy = null, ?int $limit = null, int $offset = 0): array; /** - * @param array|null> $criteria Map of column names to values that will be used as part of WHERE query + * @param array|\Stringable|\Doctrine\Common\Collections\Expr\Expression> $criteria Map of column names to values that will be used as part of WHERE query * @param array|null $orderBy Map of column names to "ASC" or "DESC", that will be used in SORT query * * @phpstan-param array|null $orderBy From 3be40fdb2415a192d5d0c0acfac479777aea1880 Mon Sep 17 00:00:00 2001 From: Sztig Date: Fri, 20 Mar 2026 14:34:30 +0100 Subject: [PATCH 2/3] extended possible params for countBy, findBy and findOneBy in GatewayInterface to be able to use AbstractUid - needed for php7.4 --- src/contracts/Gateway/GatewayInterface.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/contracts/Gateway/GatewayInterface.php b/src/contracts/Gateway/GatewayInterface.php index 21cfabd..f9a77c1 100644 --- a/src/contracts/Gateway/GatewayInterface.php +++ b/src/contracts/Gateway/GatewayInterface.php @@ -23,7 +23,7 @@ public function getMetadata(): DoctrineSchemaMetadataInterface; public function countAll(): int; /** - * @param \Doctrine\Common\Collections\Expr\Expression|array|\Stringable|\Doctrine\Common\Collections\Expr\Expression> $criteria $criteria + * @param \Doctrine\Common\Collections\Expr\Expression|array|\Stringable|\Symfony\Component\Uid\AbstractUid|\Doctrine\Common\Collections\Expr\Expression> $criteria $criteria */ public function countBy($criteria): int; @@ -33,7 +33,7 @@ public function countBy($criteria): int; public function findAll(?int $limit = null, int $offset = 0): array; /** - * @param \Doctrine\Common\Collections\Expr\Expression|array|\Stringable|\Doctrine\Common\Collections\Expr\Expression> $criteria Map of column names to values that will be used as part of WHERE query + * @param \Doctrine\Common\Collections\Expr\Expression|array|\Stringable|\Symfony\Component\Uid\AbstractUid|\Doctrine\Common\Collections\Expr\Expression> $criteria Map of column names to values that will be used as part of WHERE query * @param array|null $orderBy Map of column names to "ASC" or "DESC", that will be used in SORT query * * @phpstan-param array|null $orderBy @@ -43,7 +43,7 @@ public function findAll(?int $limit = null, int $offset = 0): array; public function findBy($criteria, ?array $orderBy = null, ?int $limit = null, int $offset = 0): array; /** - * @param array|\Stringable|\Doctrine\Common\Collections\Expr\Expression> $criteria Map of column names to values that will be used as part of WHERE query + * @param array|\Stringable|\Symfony\Component\Uid\AbstractUid|\Doctrine\Common\Collections\Expr\Expression> $criteria Map of column names to values that will be used as part of WHERE query * @param array|null $orderBy Map of column names to "ASC" or "DESC", that will be used in SORT query * * @phpstan-param array|null $orderBy From 8055b4138c1a264c2cece0adabfc70d6e51e6061 Mon Sep 17 00:00:00 2001 From: Sztig Date: Thu, 26 Mar 2026 14:29:06 +0100 Subject: [PATCH 3/3] added symfony/uid to composer.json and extened the params --- composer.json | 1 + src/contracts/Gateway/AbstractDoctrineDatabase.php | 8 ++++---- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/composer.json b/composer.json index b4030e0..8b81ac7 100644 --- a/composer.json +++ b/composer.json @@ -14,6 +14,7 @@ "symfony/event-dispatcher": "^5.4", "symfony/http-foundation": "^5.4", "symfony/http-kernel": "^5.4", + "symfony/uid": "^5.4", "symfony/yaml": "^5.4" }, "require-dev": { diff --git a/src/contracts/Gateway/AbstractDoctrineDatabase.php b/src/contracts/Gateway/AbstractDoctrineDatabase.php index 4c20b50..5b32ad8 100644 --- a/src/contracts/Gateway/AbstractDoctrineDatabase.php +++ b/src/contracts/Gateway/AbstractDoctrineDatabase.php @@ -117,7 +117,7 @@ public function countAll(): int } /** - * @param \Doctrine\Common\Collections\Expr\Expression|array|null> $criteria + * @param \Doctrine\Common\Collections\Expr\Expression|array|null> $criteria * * @throws \Doctrine\DBAL\Driver\Exception * @throws \Doctrine\DBAL\Exception @@ -258,7 +258,7 @@ private function applyInheritance(QueryBuilder $qb): void } /** - * @param \Doctrine\Common\Collections\Expr\Expression|array|null> $criteria + * @param \Doctrine\Common\Collections\Expr\Expression|array|null> $criteria * * @return \Doctrine\DBAL\Query\Expression\CompositeExpression|string|null * @@ -327,7 +327,7 @@ private function buildConditionExpression(ExpressionVisitor $visitor, QueryBuild } /** - * @param scalar|array|null $value + * @param scalar|\Stringable|\Symfony\Component\Uid\AbstractUid|array|null $value * * @throws \Doctrine\DBAL\Exception * @throws \Ibexa\Contracts\CorePersistence\Exception\MappingException @@ -431,7 +431,7 @@ final protected function applyOrderBy(QueryBuilder $qb, ?array $orderBy = []): v } /** - * @param \Doctrine\Common\Collections\Expr\Expression|array|null> $criteria + * @param \Doctrine\Common\Collections\Expr\Expression|array|null> $criteria */ final protected function applyCriteria(QueryBuilder $qb, $criteria): void {