Skip to content

Commit ee6d126

Browse files
authored
Merge pull request #4433 from morozov/more-specific-statement-params-type
Require positional statement parameters to be a list
2 parents ede9e16 + 41ff58d commit ee6d126

File tree

4 files changed

+23
-23
lines changed

4 files changed

+23
-23
lines changed

src/Cache/QueryCacheProfile.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ public function getCacheKey()
7070
* Generates the real cache key from query, params, types and connection parameters.
7171
*
7272
* @param string $sql
73-
* @param array<int, mixed>|array<string, mixed> $params
73+
* @param list<mixed>|array<string, mixed> $params
7474
* @param array<int, Type|int|string|null>|array<string, Type|int|string|null> $types
7575
* @param array<string, mixed> $connectionParams
7676
*

src/Connection.php

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -468,7 +468,7 @@ public function setAutoCommit($autoCommit)
468468
* as an associative array.
469469
*
470470
* @param string $query SQL query
471-
* @param array<int, mixed>|array<string, mixed> $params Query parameters
471+
* @param list<mixed>|array<string, mixed> $params Query parameters
472472
* @param array<int, int|string|Type|null>|array<string, int|string|Type|null> $types Parameter types
473473
*
474474
* @return array<string, mixed>|false False is returned if no rows are found.
@@ -489,7 +489,7 @@ public function fetchAssociative(string $query, array $params = [], array $types
489489
* as a numerically indexed array.
490490
*
491491
* @param string $query SQL query
492-
* @param array<int, mixed>|array<string, mixed> $params Query parameters
492+
* @param list<mixed>|array<string, mixed> $params Query parameters
493493
* @param array<int, int|string|Type|null>|array<string, int|string|Type|null> $types Parameter types
494494
*
495495
* @return list< mixed>|false False is returned if no rows are found.
@@ -510,7 +510,7 @@ public function fetchNumeric(string $query, array $params = [], array $types = [
510510
* of the first row of the result.
511511
*
512512
* @param string $query SQL query
513-
* @param array<int, mixed>|array<string, mixed> $params Query parameters
513+
* @param list<mixed>|array<string, mixed> $params Query parameters
514514
* @param array<int, int|string|Type|null>|array<string, int|string|Type|null> $types Parameter types
515515
*
516516
* @return mixed|false False is returned if no rows are found.
@@ -778,7 +778,7 @@ public function quote($value, $type = ParameterType::STRING)
778778
* Prepares and executes an SQL query and returns the result as an array of numeric arrays.
779779
*
780780
* @param string $query SQL query
781-
* @param array<int, mixed>|array<string, mixed> $params Query parameters
781+
* @param list<mixed>|array<string, mixed> $params Query parameters
782782
* @param array<int, int|string|Type|null>|array<string, int|string|Type|null> $types Parameter types
783783
*
784784
* @return list<list<mixed>>
@@ -798,7 +798,7 @@ public function fetchAllNumeric(string $query, array $params = [], array $types
798798
* Prepares and executes an SQL query and returns the result as an array of associative arrays.
799799
*
800800
* @param string $query SQL query
801-
* @param array<int, mixed>|array<string, mixed> $params Query parameters
801+
* @param list<mixed>|array<string, mixed> $params Query parameters
802802
* @param array<int, int|string|Type|null>|array<string, int|string|Type|null> $types Parameter types
803803
*
804804
* @return list<array<string,mixed>>
@@ -819,7 +819,7 @@ public function fetchAllAssociative(string $query, array $params = [], array $ty
819819
* mapped to the first column and the values mapped to the second column.
820820
*
821821
* @param string $query SQL query
822-
* @param array<int, mixed>|array<string, mixed> $params Query parameters
822+
* @param list<mixed>|array<string, mixed> $params Query parameters
823823
* @param array<int, int|string|Type|null>|array<string, int|string|Type|null> $types Parameter types
824824
*
825825
* @return array<mixed,mixed>
@@ -837,7 +837,7 @@ public function fetchAllKeyValue(string $query, array $params = [], array $types
837837
* and their values.
838838
*
839839
* @param string $query SQL query
840-
* @param array<int, mixed>|array<string, mixed> $params Query parameters
840+
* @param list<mixed>|array<string, mixed> $params Query parameters
841841
* @param array<int, int|string>|array<string, int|string> $types Parameter types
842842
*
843843
* @return array<mixed,array<string,mixed>>
@@ -853,7 +853,7 @@ public function fetchAllAssociativeIndexed(string $query, array $params = [], ar
853853
* Prepares and executes an SQL query and returns the result as an array of the first column values.
854854
*
855855
* @param string $query SQL query
856-
* @param array<int, mixed>|array<string, mixed> $params Query parameters
856+
* @param list<mixed>|array<string, mixed> $params Query parameters
857857
* @param array<int, int|string|Type|null>|array<string, int|string|Type|null> $types Parameter types
858858
*
859859
* @return list<mixed>
@@ -873,7 +873,7 @@ public function fetchFirstColumn(string $query, array $params = [], array $types
873873
* Prepares and executes an SQL query and returns the result as an iterator over rows represented as numeric arrays.
874874
*
875875
* @param string $query SQL query
876-
* @param array<int, mixed>|array<string, mixed> $params Query parameters
876+
* @param list<mixed>|array<string, mixed> $params Query parameters
877877
* @param array<int, int|string|Type|null>|array<string, int|string|Type|null> $types Parameter types
878878
*
879879
* @return Traversable<int,list<mixed>>
@@ -898,7 +898,7 @@ public function iterateNumeric(string $query, array $params = [], array $types =
898898
* as associative arrays.
899899
*
900900
* @param string $query SQL query
901-
* @param array<int, mixed>|array<string, mixed> $params Query parameters
901+
* @param list<mixed>|array<string, mixed> $params Query parameters
902902
* @param array<int, int|string|Type|null>|array<string, int|string|Type|null> $types Parameter types
903903
*
904904
* @return Traversable<int,array<string,mixed>>
@@ -923,7 +923,7 @@ public function iterateAssociative(string $query, array $params = [], array $typ
923923
* mapped to the first column and the values mapped to the second column.
924924
*
925925
* @param string $query SQL query
926-
* @param array<int, mixed>|array<string, mixed> $params Query parameters
926+
* @param list<mixed>|array<string, mixed> $params Query parameters
927927
* @param array<int, int|string|Type|null>|array<string, int|string|Type|null> $types Parameter types
928928
*
929929
* @return Traversable<mixed,mixed>
@@ -941,7 +941,7 @@ public function iterateKeyValue(string $query, array $params = [], array $types
941941
* and their values.
942942
*
943943
* @param string $query SQL query
944-
* @param array<int, mixed>|array<string, mixed> $params Query parameters
944+
* @param list<mixed>|array<string, mixed> $params Query parameters
945945
* @param array<int, int|string>|array<string, int|string> $types Parameter types
946946
*
947947
* @return Traversable<mixed,array<string,mixed>>
@@ -957,7 +957,7 @@ public function iterateAssociativeIndexed(string $query, array $params = [], arr
957957
* Prepares and executes an SQL query and returns the result as an iterator over the first column values.
958958
*
959959
* @param string $query SQL query
960-
* @param array<int, mixed>|array<string, mixed> $params Query parameters
960+
* @param list<mixed>|array<string, mixed> $params Query parameters
961961
* @param array<int, int|string|Type|null>|array<string, int|string|Type|null> $types Parameter types
962962
*
963963
* @return Traversable<int,mixed>
@@ -996,7 +996,7 @@ public function prepare(string $sql): Statement
996996
* If an SQLLogger is configured, the execution is logged.
997997
*
998998
* @param string $sql SQL query
999-
* @param array<int, mixed>|array<string, mixed> $params Query parameters
999+
* @param list<mixed>|array<string, mixed> $params Query parameters
10001000
* @param array<int, int|string|Type|null>|array<string, int|string|Type|null> $types Parameter types
10011001
*
10021002
* @throws Exception
@@ -1049,7 +1049,7 @@ public function executeQuery(
10491049
* Executes a caching query.
10501050
*
10511051
* @param string $sql SQL query
1052-
* @param array<int, mixed>|array<string, mixed> $params Query parameters
1052+
* @param list<mixed>|array<string, mixed> $params Query parameters
10531053
* @param array<int, int|string|Type|null>|array<string, int|string|Type|null> $types Parameter types
10541054
*
10551055
* @throws CacheException
@@ -1106,7 +1106,7 @@ public function executeCacheQuery($sql, $params, $types, QueryCacheProfile $qcp)
11061106
* This method supports PDO binding types as well as DBAL mapping types.
11071107
*
11081108
* @param string $sql SQL statement
1109-
* @param array<int, mixed>|array<string, mixed> $params Statement parameters
1109+
* @param list<mixed>|array<string, mixed> $params Statement parameters
11101110
* @param array<int, int|string|Type|null>|array<string, int|string|Type|null> $types Parameter types
11111111
*
11121112
* @return int The number of affected rows.
@@ -1580,7 +1580,7 @@ public function convertToPHPValue($value, $type)
15801580
* or DBAL mapping type, to a given statement.
15811581
*
15821582
* @param DriverStatement $stmt Prepared statement
1583-
* @param array<int, mixed>|array<string, mixed> $params Statement parameters
1583+
* @param list<mixed>|array<string, mixed> $params Statement parameters
15841584
* @param array<int, int|string|Type|null>|array<string, int|string|Type|null> $types Parameter types
15851585
*
15861586
* @throws Exception
@@ -1655,7 +1655,7 @@ public function createQueryBuilder()
16551655
/**
16561656
* @internal
16571657
*
1658-
* @param array<int, mixed>|array<string, mixed> $params
1658+
* @param list<mixed>|array<string, mixed> $params
16591659
* @param array<int, int|string|Type|null>|array<string, int|string|Type|null> $types
16601660
*/
16611661
final public function convertExceptionDuringQuery(

src/Logging/SQLLogger.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ interface SQLLogger
1313
* Logs a SQL statement somewhere.
1414
*
1515
* @param string $sql SQL statement
16-
* @param array<int, mixed>|array<string, mixed>|null $params Statement parameters
16+
* @param list<mixed>|array<string, mixed>|null $params Statement parameters
1717
* @param array<int, Type|int|string|null>|array<string, Type|int|string|null>|null $types Parameter types
1818
*
1919
* @return void

src/Query/QueryBuilder.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ class QueryBuilder
9090
/**
9191
* The query parameters.
9292
*
93-
* @var array<int, mixed>|array<string, mixed>
93+
* @var list<mixed>|array<string, mixed>
9494
*/
9595
private $params = [];
9696

@@ -298,7 +298,7 @@ public function setParameter($key, $value, $type = null)
298298
* ));
299299
* </code>
300300
*
301-
* @param array<int, mixed>|array<string, mixed> $params Parameters to set
301+
* @param list<mixed>|array<string, mixed> $params Parameters to set
302302
* @param array<int, int|string|Type|null>|array<string, int|string|Type|null> $types Parameter types
303303
*
304304
* @return $this This QueryBuilder instance.
@@ -314,7 +314,7 @@ public function setParameters(array $params, array $types = [])
314314
/**
315315
* Gets all defined query parameters for the query being constructed indexed by parameter index or name.
316316
*
317-
* @return array<int, mixed>|array<string, mixed> The currently defined query parameters
317+
* @return list<mixed>|array<string, mixed> The currently defined query parameters
318318
*/
319319
public function getParameters()
320320
{

0 commit comments

Comments
 (0)