diff --git a/src/DatabaseSelectBuilder.php b/src/DatabaseSelectBuilder.php index 34e0c70..3d9dfcd 100644 --- a/src/DatabaseSelectBuilder.php +++ b/src/DatabaseSelectBuilder.php @@ -22,7 +22,7 @@ final class DatabaseSelectBuilder public const DEFAULT_LIMIT = 20; private QueryBuilder $builder; private Table $from; - /** @var array [class => doctrine type, ...] */ + /** @var array [class => doctrine type, ...] */ private array $types; /** @var array [model field => query field, ...] */ private array $sortMap = []; @@ -31,7 +31,7 @@ final class DatabaseSelectBuilder /** @var array */ private array $fieldSelect = []; - /** @param array $types */ + /** @param array $types */ public function __construct(Connection $connection, array $types = [DateTimeImmutable::class => 'DateTimeImmutable']) { $this->builder = $connection->createQueryBuilder(); @@ -52,7 +52,7 @@ public function resetForConnection(Connection $connection): self return $copy; } - /** @param array $types */ + /** @param array $types */ public function withTypes(array $types): self { $copy = clone $this; @@ -125,7 +125,7 @@ public function rightJoin(Table $join, string $condition): self /** * @param array $params - * @param array $types + * @param array $types */ public function where(string $condition, array $params = [], array $types = []): self { @@ -140,7 +140,7 @@ public function where(string $condition, array $params = [], array $types = []): /** * @param array $params - * @param array $types + * @param array $types */ public function having(string $condition, array $params = [], array $types = []): self { @@ -278,7 +278,7 @@ public function withParameter(string $key, mixed $value, string|ParameterType|Ty /** * @param array $params - * @param array $types + * @param array $types */ public function withParameters(array $params = [], array $types = []): self { @@ -328,7 +328,7 @@ public function startOffset(): int return $this->startOffset; } - private function paramType(mixed $object): string|ParameterType|ArrayParameterType + private function paramType(mixed $object): string|ParameterType|Type|ArrayParameterType { if (is_array($object)) { return ArrayParameterType::STRING; diff --git a/src/Query/AbstractDatabaseQuery.php b/src/Query/AbstractDatabaseQuery.php index eeb9118..1445671 100644 --- a/src/Query/AbstractDatabaseQuery.php +++ b/src/Query/AbstractDatabaseQuery.php @@ -2,7 +2,10 @@ namespace GW\DQO\Query; +use Doctrine\DBAL\ArrayParameterType; use Doctrine\DBAL\Connection; +use Doctrine\DBAL\ParameterType; +use Doctrine\DBAL\Types\Type; use GW\DQO\DatabaseSelectBuilder; use GW\DQO\Table; use function in_array; @@ -36,7 +39,7 @@ public function resetForConnection(Connection $connection): self /** * @return static * @param array $params - * @param array $types + * @param array $types */ public function join(Table $join, string $condition, array $params = [], array $types = []): self { @@ -50,7 +53,7 @@ public function join(Table $join, string $condition, array $params = [], array $ /** * @return static * @param array $params - * @param array $types + * @param array $types */ public function leftJoin(Table $join, string $condition, array $params = [], array $types = []): self { @@ -76,7 +79,7 @@ public function joinOnce(Table $join, string $condition): self /** * @return static * @param array $params - * @param array $types + * @param array $types */ public function where(string $condition, array $params = [], array $types = []): self { @@ -89,7 +92,7 @@ public function where(string $condition, array $params = [], array $types = []): /** * @return static * @param array $params - * @param array $types + * @param array $types */ public function having(string $condition, array $params = [], array $types = []): self {