From 06ba8a6109489aca4c69e4decea3320efe859fd2 Mon Sep 17 00:00:00 2001 From: "Alexander M. Turek" Date: Thu, 29 Dec 2022 17:59:42 +0100 Subject: [PATCH] Introduce a ArrayParameterType enum --- UPGRADE.md | 4 + src/ArrayParameterType.php | 23 +--- src/Cache/QueryCacheProfile.php | 11 +- src/Connection.php | 122 ++++++++---------- src/ExpandArrayParameters.php | 17 +-- src/Query.php | 9 +- src/Query/QueryBuilder.php | 28 ++-- .../Connection/ExpandArrayParametersTest.php | 43 ++++-- tests/Functional/NamedParametersTest.php | 17 ++- tests/Query/QueryBuilderTest.php | 52 ++++---- 10 files changed, 160 insertions(+), 166 deletions(-) diff --git a/UPGRADE.md b/UPGRADE.md index b4ea18bb0c0..ff780860156 100644 --- a/UPGRADE.md +++ b/UPGRADE.md @@ -8,6 +8,10 @@ awareness about deprecated code. # Upgrade to 4.0 +## Removed `Connection::PARAM_*_ARRAY` constants + +Use the enum `ArrayParameterType` instead. + ## Disallowed partial version numbers in ``serverVersion`` The ``serverVersion`` connection parameter must consist of 3 numbers: diff --git a/src/ArrayParameterType.php b/src/ArrayParameterType.php index 0af5b1696fd..6e3877746d2 100644 --- a/src/ArrayParameterType.php +++ b/src/ArrayParameterType.php @@ -4,41 +4,30 @@ namespace Doctrine\DBAL; -use Doctrine\DBAL\ArrayParameters\Exception\InvalidParameterType; - -final class ArrayParameterType +enum ArrayParameterType { /** * Represents an array of ints to be expanded by Doctrine SQL parsing. */ - public const INTEGER = 101; + case INTEGER; /** * Represents an array of strings to be expanded by Doctrine SQL parsing. */ - public const STRING = 102; + case STRING; /** * Represents an array of ascii strings to be expanded by Doctrine SQL parsing. */ - public const ASCII = 117; + case ASCII; - /** - * @internal - * - * @psalm-param self::INTEGER|self::STRING|self::ASCII $type - */ - public static function toElementParameterType(int $type): ParameterType + /** @internal */ + public static function toElementParameterType(self $type): ParameterType { return match ($type) { self::INTEGER => ParameterType::INTEGER, self::STRING => ParameterType::STRING, self::ASCII => ParameterType::ASCII, - default => throw InvalidParameterType::new($type), }; } - - private function __construct() - { - } } diff --git a/src/Cache/QueryCacheProfile.php b/src/Cache/QueryCacheProfile.php index 07a804d5926..b085f6cab0a 100644 --- a/src/Cache/QueryCacheProfile.php +++ b/src/Cache/QueryCacheProfile.php @@ -5,8 +5,7 @@ namespace Doctrine\DBAL\Cache; use Doctrine\DBAL\Cache\Exception\NoCacheKey; -use Doctrine\DBAL\ParameterType; -use Doctrine\DBAL\Types\Type; +use Doctrine\DBAL\Connection; use Psr\Cache\CacheItemPoolInterface; use function hash; @@ -17,6 +16,8 @@ * Query Cache Profile handles the data relevant for query caching. * * It is a value object, setter methods return NEW instances. + * + * @psalm-import-type WrapperParameterType from Connection */ class QueryCacheProfile { @@ -50,9 +51,9 @@ public function getCacheKey(): string /** * Generates the real cache key from query, params, types and connection parameters. * - * @param list|array $params - * @param array|array $types - * @param array $connectionParams + * @param list|array $params + * @param array $connectionParams + * @psalm-param array|array $types * * @return array{string, string} */ diff --git a/src/Connection.php b/src/Connection.php index 3b45bc2f556..b703cdd4801 100644 --- a/src/Connection.php +++ b/src/Connection.php @@ -43,31 +43,12 @@ * configuration, emulated transaction nesting, lazy connecting and more. * * @psalm-import-type Params from DriverManager + * @psalm-type WrapperParameterType = string|Type|ParameterType|ArrayParameterType + * @psalm-type WrapperParameterTypeArray = array|array * @psalm-consistent-constructor */ class Connection implements ServerVersionProvider { - /** - * Represents an array of integers to be expanded by Doctrine SQL parsing. - * - * @deprecated Use {@see ArrayParameterType::INTEGER} instead. - */ - public const PARAM_INT_ARRAY = ArrayParameterType::INTEGER; - - /** - * Represents an array of strings to be expanded by Doctrine SQL parsing. - * - * @deprecated Use {@see ArrayParameterType::STRING} instead. - */ - public const PARAM_STR_ARRAY = ArrayParameterType::STRING; - - /** - * Represents an array of ascii strings to be expanded by Doctrine SQL parsing. - * - * @deprecated Use {@see ArrayParameterType::ASCII} instead. - */ - public const PARAM_ASCII_STR_ARRAY = ArrayParameterType::ASCII; - /** * The wrapped driver connection. */ @@ -290,8 +271,8 @@ public function setAutoCommit(bool $autoCommit): void * Prepares and executes an SQL query and returns the first row of the result * as an associative array. * - * @param list|array $params - * @param array|array $types + * @param list|array $params + * @psalm-param WrapperParameterTypeArray $types * * @return array|false False is returned if no rows are found. * @@ -306,8 +287,8 @@ public function fetchAssociative(string $query, array $params = [], array $types * Prepares and executes an SQL query and returns the first row of the result * as a numerically indexed array. * - * @param list|array $params - * @param array|array $types + * @param list|array $params + * @psalm-param WrapperParameterTypeArray $types * * @return list|false False is returned if no rows are found. * @@ -322,8 +303,8 @@ public function fetchNumeric(string $query, array $params = [], array $types = [ * Prepares and executes an SQL query and returns the value of a single column * of the first row of the result. * - * @param list|array $params - * @param array|array $types + * @param list|array $params + * @psalm-param WrapperParameterTypeArray $types * * @return mixed|false False is returned if no rows are found. * @@ -385,8 +366,8 @@ private function addCriteriaCondition( * * Table expression and columns are not escaped and are not safe for user-input. * - * @param array $criteria - * @param array|array $types + * @param array $criteria + * @param array|array $types * * @return int|string The number of affected rows. * @@ -451,9 +432,9 @@ public function getTransactionIsolation(): TransactionIsolationLevel * * Table expression and columns are not escaped and are not safe for user-input. * - * @param array $data - * @param array $criteria - * @param array|array $types + * @param array $data + * @param array $criteria + * @param array|array $types * * @return int|string The number of affected rows. * @@ -489,8 +470,8 @@ public function update(string $table, array $data, array $criteria = [], array $ * * Table expression and columns are not escaped and are not safe for user-input. * - * @param array $data - * @param array|array $types + * @param array $data + * @param array|array $types * * @return int|string The number of affected rows. * @@ -523,10 +504,10 @@ public function insert(string $table, array $data, array $types = []): int|strin /** * Extract ordered type list from an ordered column list and type map. * - * @param array $columns - * @param array|array $types + * @param array $columns + * @param array|array $types * - * @return array|array + * @return array|array */ private function extractTypeValues(array $columns, array $types): array { @@ -570,8 +551,8 @@ public function quote(string $value): string /** * Prepares and executes an SQL query and returns the result as an array of numeric arrays. * - * @param list|array $params - * @param array|array $types + * @param list|array $params + * @psalm-param WrapperParameterTypeArray $types * * @return list> * @@ -585,8 +566,8 @@ public function fetchAllNumeric(string $query, array $params = [], array $types /** * Prepares and executes an SQL query and returns the result as an array of associative arrays. * - * @param list|array $params - * @param array|array $types + * @param list|array $params + * @psalm-param WrapperParameterTypeArray $types * * @return list> * @@ -601,8 +582,8 @@ public function fetchAllAssociative(string $query, array $params = [], array $ty * Prepares and executes an SQL query and returns the result as an associative array with the keys * mapped to the first column and the values mapped to the second column. * - * @param list|array $params - * @param array|array $types + * @param list|array $params + * @psalm-param WrapperParameterTypeArray $types * * @return array * @@ -618,8 +599,8 @@ public function fetchAllKeyValue(string $query, array $params = [], array $types * to the first column and the values being an associative array representing the rest of the columns * and their values. * - * @param list|array $params - * @param array|array $types + * @param list|array $params + * @psalm-param WrapperParameterTypeArray $types * * @return array> * @@ -633,8 +614,8 @@ public function fetchAllAssociativeIndexed(string $query, array $params = [], ar /** * Prepares and executes an SQL query and returns the result as an array of the first column values. * - * @param list|array $params - * @param array|array $types + * @param list|array $params + * @psalm-param WrapperParameterTypeArray $types * * @return list * @@ -648,8 +629,8 @@ public function fetchFirstColumn(string $query, array $params = [], array $types /** * Prepares and executes an SQL query and returns the result as an iterator over rows represented as numeric arrays. * - * @param list|array $params - * @param array|array $types + * @param list|array $params + * @psalm-param WrapperParameterTypeArray $types * * @return Traversable> * @@ -664,8 +645,8 @@ public function iterateNumeric(string $query, array $params = [], array $types = * Prepares and executes an SQL query and returns the result as an iterator over rows represented * as associative arrays. * - * @param list|array $params - * @param array|array $types + * @param list|array $params + * @psalm-param WrapperParameterTypeArray $types * * @return Traversable> * @@ -680,8 +661,8 @@ public function iterateAssociative(string $query, array $params = [], array $typ * Prepares and executes an SQL query and returns the result as an iterator with the keys * mapped to the first column and the values mapped to the second column. * - * @param list|array $params - * @param array|array $types + * @param list|array $params + * @psalm-param WrapperParameterTypeArray $types * * @return Traversable * @@ -697,9 +678,8 @@ public function iterateKeyValue(string $query, array $params = [], array $types * to the first column and the values being an associative array representing the rest of the columns * and their values. * - * @param string $query SQL query - * @param list|array $params - * @param array|array $types + * @param list|array $params + * @psalm-param WrapperParameterTypeArray $types * * @return Traversable> * @@ -713,8 +693,8 @@ public function iterateAssociativeIndexed(string $query, array $params = [], arr /** * Prepares and executes an SQL query and returns the result as an iterator over the first column values. * - * @param list|array $params - * @param array|array $types + * @param list|array $params + * @psalm-param WrapperParameterTypeArray $types * * @return Traversable * @@ -750,8 +730,8 @@ public function prepare(string $sql): Statement * * If the query is parametrized, a prepared statement is used. * - * @param list|array $params - * @param array|array $types + * @param list|array $params + * @psalm-param WrapperParameterTypeArray $types * * @throws Exception */ @@ -789,8 +769,8 @@ public function executeQuery( /** * Executes a caching query. * - * @param list|array $params - * @param array|array $types + * @param list|array $params + * @psalm-param WrapperParameterTypeArray $types * * @throws CacheException * @throws Exception @@ -844,8 +824,8 @@ public function executeCacheQuery(string $sql, array $params, array $types, Quer * * This method supports PDO binding types as well as DBAL mapping types. * - * @param list|array $params - * @param array|array $types + * @param list|array $params + * @psalm-param WrapperParameterTypeArray $types * * @throws Exception */ @@ -1296,8 +1276,8 @@ public function createQueryBuilder(): QueryBuilder /** * @internal * - * @param list|array $params - * @param array|array $types + * @param list|array $params + * @psalm-param WrapperParameterTypeArray $types */ final public function convertExceptionDuringQuery( Driver\Exception $e, @@ -1315,8 +1295,8 @@ final public function convertException(Driver\Exception $e): DriverException } /** - * @param array|array $params - * @param array|array $types + * @param array|array $params + * @psalm-param WrapperParameterTypeArray $types * * @return array{ * string, @@ -1333,7 +1313,7 @@ private function expandArrayParameters(string $sql, array $params, array $types) $needsConversion = true; } else { foreach ($types as $key => $type) { - if (is_int($type)) { + if ($type instanceof ArrayParameterType) { $needsConversion = true; break; } @@ -1377,8 +1357,8 @@ private function handleDriverException( * * @deprecated This API is deprecated and will be removed after 2022 * - * @param array|array $params - * @param array|array $types + * @param array|array $params + * @psalm-param WrapperParameterTypeArray $types * * @throws Exception */ diff --git a/src/ExpandArrayParameters.php b/src/ExpandArrayParameters.php index 4b0287d67c5..0efd3fd5f7f 100644 --- a/src/ExpandArrayParameters.php +++ b/src/ExpandArrayParameters.php @@ -14,9 +14,9 @@ use function array_key_exists; use function count; use function implode; -use function is_int; use function substr; +/** @psalm-import-type WrapperParameterTypeArray from Connection */ final class ExpandArrayParameters implements Visitor { private int $originalParameterIndex = 0; @@ -31,11 +31,13 @@ final class ExpandArrayParameters implements Visitor private array $convertedTypes = []; /** - * @param array|array $parameters - * @param array|array $types + * @param array|array $parameters + * @psalm-param WrapperParameterTypeArray $types */ - public function __construct(private readonly array $parameters, private readonly array $types) - { + public function __construct( + private readonly array $parameters, + private readonly array $types, + ) { } public function acceptPositionalParameter(string $sql): void @@ -90,7 +92,7 @@ private function acceptParameter(int|string $key, mixed $value): void $type = $this->types[$key]; - if (! is_int($type)) { + if (! $type instanceof ArrayParameterType) { $this->appendTypedParameter([$value], $type); return; @@ -102,8 +104,7 @@ private function acceptParameter(int|string $key, mixed $value): void return; } - /** @psalm-suppress ArgumentTypeCoercion */ - $this->appendTypedParameter($value, ArrayParameterType::toElementParameterType($type)); // @phpstan-ignore-line + $this->appendTypedParameter($value, ArrayParameterType::toElementParameterType($type)); } /** @return array */ diff --git a/src/Query.php b/src/Query.php index ee89fbdb35f..b673ba889df 100644 --- a/src/Query.php +++ b/src/Query.php @@ -4,18 +4,17 @@ namespace Doctrine\DBAL; -use Doctrine\DBAL\Types\Type; - /** * An SQL query together with its bound parameters. * * @psalm-immutable + * @psalm-import-type WrapperParameterType from Connection */ final class Query { /** - * @param array $params - * @param array $types + * @param array $params + * @psalm-param array $types * * @psalm-suppress ImpurePropertyAssignment */ @@ -37,7 +36,7 @@ public function getParams(): array return $this->params; } - /** @return array */ + /** @psalm-return array */ public function getTypes(): array { return $this->types; diff --git a/src/Query/QueryBuilder.php b/src/Query/QueryBuilder.php index 6ea28cd6ec8..8b15ad7f1c1 100644 --- a/src/Query/QueryBuilder.php +++ b/src/Query/QueryBuilder.php @@ -4,6 +4,7 @@ namespace Doctrine\DBAL\Query; +use Doctrine\DBAL\ArrayParameterType; use Doctrine\DBAL\Cache\QueryCacheProfile; use Doctrine\DBAL\Connection; use Doctrine\DBAL\Exception; @@ -15,7 +16,6 @@ use Doctrine\DBAL\Result; use Doctrine\DBAL\Statement; use Doctrine\DBAL\Types\Type; -use Doctrine\Deprecations\Deprecation; use function array_key_exists; use function array_keys; @@ -35,6 +35,8 @@ * The query builder does no validation whatsoever if certain features even work with the * underlying database vendor. Limit queries and joins are NOT applied to UPDATE and DELETE statements * even if some vendors such as MySQL support it. + * + * @psalm-import-type WrapperParameterTypeArray from Connection */ class QueryBuilder { @@ -48,12 +50,12 @@ class QueryBuilder * * @var list|array */ - private $params = []; + private array $params = []; /** * The parameter type map of this query. * - * @var array|array + * @psalm-var WrapperParameterTypeArray */ private array $types = []; @@ -345,16 +347,14 @@ public function getSQL(): string * ->setParameter('user_id', 1); * * - * @param int|string $key Parameter position or name - * @param mixed $value Parameter value - * @param string|ParameterType|Type $type Parameter type + * @param int|string $key Parameter position or name * * @return $this This QueryBuilder instance. */ public function setParameter( int|string $key, mixed $value, - string|ParameterType|Type $type = ParameterType::STRING, + string|ParameterType|Type|ArrayParameterType $type = ParameterType::STRING, ): self { $this->params[$key] = $value; $this->types[$key] = $type; @@ -376,8 +376,8 @@ public function setParameter( * )); * * - * @param list|array $params - * @param array|array $types + * @param list|array $params + * @psalm-param WrapperParameterTypeArray $types * * @return $this This QueryBuilder instance. */ @@ -414,7 +414,7 @@ public function getParameter(string|int $key): mixed /** * Gets all defined query parameter types for the query being constructed indexed by parameter index or name. * - * @return array|array + * @psalm-return WrapperParameterTypeArray */ public function getParameterTypes(): array { @@ -425,10 +425,8 @@ public function getParameterTypes(): array * Gets a (previously set) query parameter type of the query being constructed. * * @param int|string $key The key of the bound parameter type - * - * @return int|string|ParameterType|Type The value of the bound parameter type */ - public function getParameterType(int|string $key): int|string|ParameterType|Type + public function getParameterType(int|string $key): string|ParameterType|Type|ArrayParameterType { return $this->types[$key] ?? ParameterType::STRING; } @@ -1311,7 +1309,7 @@ public function __toString(): string */ public function createNamedParameter( mixed $value, - string|ParameterType|Type $type = ParameterType::STRING, + string|ParameterType|Type|ArrayParameterType $type = ParameterType::STRING, ?string $placeHolder = null, ): string { if ($placeHolder === null) { @@ -1343,7 +1341,7 @@ public function createNamedParameter( */ public function createPositionalParameter( mixed $value, - string|ParameterType|Type $type = ParameterType::STRING, + string|ParameterType|Type|ArrayParameterType $type = ParameterType::STRING, ): string { $this->setParameter($this->boundCounter, $value, $type); $this->boundCounter++; diff --git a/tests/Connection/ExpandArrayParametersTest.php b/tests/Connection/ExpandArrayParametersTest.php index cd8d5dbfcba..27e7c330c72 100644 --- a/tests/Connection/ExpandArrayParametersTest.php +++ b/tests/Connection/ExpandArrayParametersTest.php @@ -7,15 +7,26 @@ use Doctrine\DBAL\ArrayParameters\Exception\MissingNamedParameter; use Doctrine\DBAL\ArrayParameters\Exception\MissingPositionalParameter; use Doctrine\DBAL\ArrayParameterType; +use Doctrine\DBAL\Connection; use Doctrine\DBAL\ExpandArrayParameters; use Doctrine\DBAL\ParameterType; use Doctrine\DBAL\SQL\Parser; use Doctrine\DBAL\Types\Type; use PHPUnit\Framework\TestCase; +/** @psalm-import-type WrapperParameterTypeArray from Connection */ class ExpandArrayParametersTest extends TestCase { - /** @return mixed[][] */ + /** + * @psalm-return iterable|array, + * WrapperParameterTypeArray, + * string, + * array|array, + * array|array, + * }> + */ public static function dataExpandListParameters(): iterable { return [ @@ -316,10 +327,10 @@ public static function dataExpandListParameters(): iterable } /** - * @param array|array $params - * @param array|array $types - * @param list $expectedParams - * @param array $expectedTypes + * @param array|array $params + * @param array|array $expectedParams + * @param array|array $expectedTypes + * @psalm-param WrapperParameterTypeArray $types * * @dataProvider dataExpandListParameters */ @@ -338,7 +349,13 @@ public function testExpandListParameters( self::assertEquals($expectedTypes, $types, 'Types dont match'); } - /** @return mixed[][] */ + /** + * @return list, + * array + * }> + */ public static function missingNamedParameterProvider(): iterable { return [ @@ -366,8 +383,8 @@ public static function missingNamedParameterProvider(): iterable } /** - * @param array|array $params - * @param array|array $types + * @param array $params + * @param array $types * * @dataProvider missingNamedParameterProvider */ @@ -379,7 +396,7 @@ public function testMissingNamedParameter(string $query, array $params, array $t } /** - * @param array|array $params + * @param list $params * * @dataProvider missingPositionalParameterProvider */ @@ -390,7 +407,7 @@ public function testMissingPositionalParameter(string $query, array $params): vo $this->expandArrayParameters($query, $params, []); } - /** @return mixed[][] */ + /** @return iterable}> */ public static function missingPositionalParameterProvider(): iterable { return [ @@ -406,10 +423,10 @@ public static function missingPositionalParameterProvider(): iterable } /** - * @param array|array $params - * @param array|array $types + * @param array|array $params + * @psalm-param WrapperParameterTypeArray $types * - * @return array{string, list, array} + * @return array{string, list, array} */ private function expandArrayParameters(string $sql, array $params, array $types): array { diff --git a/tests/Functional/NamedParametersTest.php b/tests/Functional/NamedParametersTest.php index 13a6e763824..c7f5732f6a0 100644 --- a/tests/Functional/NamedParametersTest.php +++ b/tests/Functional/NamedParametersTest.php @@ -5,6 +5,7 @@ namespace Doctrine\DBAL\Tests\Functional; use Doctrine\DBAL\ArrayParameterType; +use Doctrine\DBAL\Connection; use Doctrine\DBAL\ParameterType; use Doctrine\DBAL\Schema\Table; use Doctrine\DBAL\Tests\FunctionalTestCase; @@ -14,9 +15,17 @@ use const CASE_LOWER; +/** @psalm-import-type WrapperParameterType from Connection */ class NamedParametersTest extends FunctionalTestCase { - /** @return iterable> */ + /** + * @psalm-return iterable, + * array, + * list>, + * }> + */ public static function ticketProvider(): iterable { return [ @@ -200,9 +209,9 @@ protected function setUp(): void } /** - * @param mixed[] $params - * @param int[] $types - * @param int[] $expected + * @param array $params + * @param list> $expected + * @psalm-param array $types * * @dataProvider ticketProvider */ diff --git a/tests/Query/QueryBuilderTest.php b/tests/Query/QueryBuilderTest.php index 34706edcb87..0153f7f4820 100644 --- a/tests/Query/QueryBuilderTest.php +++ b/tests/Query/QueryBuilderTest.php @@ -12,11 +12,11 @@ use Doctrine\DBAL\Query\QueryBuilder; use Doctrine\DBAL\Query\QueryException; use Doctrine\DBAL\Result; -use Doctrine\DBAL\Types\Type; use Doctrine\DBAL\Types\Types; use PHPUnit\Framework\MockObject\MockObject; use PHPUnit\Framework\TestCase; +/** @psalm-import-type WrapperParameterTypeArray from Connection */ class QueryBuilderTest extends TestCase { /** @var Connection&MockObject */ @@ -802,20 +802,16 @@ public function testGetParameterTypes(): void public function testArrayParameters(): void { - self::markTestSkipped('FIXME'); - - $qb = new QueryBuilder($this->conn); // @phpstan-ignore-line + $qb = new QueryBuilder($this->conn); $qb->select('*')->from('users'); self::assertSame([], $qb->getParameterTypes()); $qb->where('id IN (:ids)'); - /** @psalm-suppress InvalidArgument */ $qb->setParameter('ids', [1, 2, 3], ArrayParameterType::INTEGER); $qb->andWhere('name IN (:names)'); - /** @psalm-suppress InvalidArgument */ $qb->setParameter('names', ['john', 'jane'], ArrayParameterType::STRING); self::assertSame(ArrayParameterType::INTEGER, $qb->getParameterType('ids')); @@ -844,8 +840,8 @@ public function testJoinWithNonUniqueAliasThrowsException(): void } /** - * @param list|array $parameters - * @param array|array $parameterTypes + * @param list|array $parameters + * @psalm-param WrapperParameterTypeArray $parameterTypes * * @dataProvider fetchProvider */ @@ -879,8 +875,8 @@ public function testFetchAssociative( } /** - * @param list|array $parameters - * @param array|array $parameterTypes + * @param list|array $parameters + * @psalm-param WrapperParameterTypeArray $parameterTypes * * @dataProvider fetchProvider */ @@ -914,8 +910,8 @@ public function testFetchNumeric( } /** - * @param list|array $parameters - * @param array|array $parameterTypes + * @param list|array $parameters + * @param WrapperParameterTypeArray $parameterTypes * * @dataProvider fetchProvider */ @@ -949,8 +945,8 @@ public function testFetchOne( } /** - * @param list|array $parameters - * @param array|array $parameterTypes + * @param list|array $parameters + * @psalm-param WrapperParameterTypeArray $parameterTypes * * @dataProvider fetchProvider */ @@ -995,8 +991,8 @@ public function testFetchAllAssociative( } /** - * @param list|array $parameters - * @param array|array $parameterTypes + * @param list|array $parameters + * @psalm-param WrapperParameterTypeArray $parameterTypes * * @dataProvider fetchProvider */ @@ -1041,8 +1037,8 @@ public function testFetchAllNumeric( } /** - * @param list|array $parameters - * @param array|array $parameterTypes + * @param list|array $parameters + * @psalm-param WrapperParameterTypeArray $parameterTypes * * @dataProvider fetchProvider */ @@ -1087,8 +1083,8 @@ public function testFetchAllKeyValue( } /** - * @param list|array $parameters - * @param array|array $parameterTypes + * @param list|array $parameters + * @psalm-param WrapperParameterTypeArray $parameterTypes * * @dataProvider fetchProvider */ @@ -1137,8 +1133,8 @@ public function testFetchAllAssociativeIndexed( } /** - * @param list|array $parameters - * @param array|array $parameterTypes + * @param list|array $parameters + * @psalm-param WrapperParameterTypeArray $parameterTypes * * @dataProvider fetchProvider */ @@ -1183,14 +1179,14 @@ public function testFetchFirstColumn( } /** - * @return iterable< + * @psalm-return iterable< * string, * array{ * string, * string, * string, * list|array, - * array|array, + * WrapperParameterTypeArray, * string * }> */ @@ -1234,8 +1230,8 @@ public static function fetchProvider(): iterable } /** - * @param list|array $params - * @param array|array $types + * @param list|array $params + * @psalm-param WrapperParameterTypeArray $types * * @dataProvider fetchProvider */ @@ -1268,8 +1264,8 @@ public function testExecuteQuery( } /** - * @param list|array $parameters - * @param array|array $parameterTypes + * @param list|array $parameters + * @psalm-param WrapperParameterTypeArray $parameterTypes * * @dataProvider fetchProvider */