Skip to content

Commit

Permalink
Positional statement parameters are a list
Browse files Browse the repository at this point in the history
  • Loading branch information
morozov committed Nov 15, 2020
1 parent a501e55 commit 41ff58d
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 23 deletions.
2 changes: 1 addition & 1 deletion src/Cache/QueryCacheProfile.php
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ public function getCacheKey()
* Generates the real cache key from query, params, types and connection parameters.
*
* @param string $sql
* @param array<int, mixed>|array<string, mixed> $params
* @param list<mixed>|array<string, mixed> $params
* @param array<int, Type|int|string|null>|array<string, Type|int|string|null> $types
* @param array<string, mixed> $connectionParams
*
Expand Down
36 changes: 18 additions & 18 deletions src/Connection.php
Original file line number Diff line number Diff line change
Expand Up @@ -464,7 +464,7 @@ public function setAutoCommit($autoCommit)
* as an associative array.
*
* @param string $query SQL query
* @param array<int, mixed>|array<string, mixed> $params Query parameters
* @param list<mixed>|array<string, mixed> $params Query parameters
* @param array<int, int|string|Type|null>|array<string, int|string|Type|null> $types Parameter types
*
* @return array<string, mixed>|false False is returned if no rows are found.
Expand All @@ -485,7 +485,7 @@ public function fetchAssociative(string $query, array $params = [], array $types
* as a numerically indexed array.
*
* @param string $query SQL query
* @param array<int, mixed>|array<string, mixed> $params Query parameters
* @param list<mixed>|array<string, mixed> $params Query parameters
* @param array<int, int|string|Type|null>|array<string, int|string|Type|null> $types Parameter types
*
* @return list< mixed>|false False is returned if no rows are found.
Expand All @@ -506,7 +506,7 @@ public function fetchNumeric(string $query, array $params = [], array $types = [
* of the first row of the result.
*
* @param string $query SQL query
* @param array<int, mixed>|array<string, mixed> $params Query parameters
* @param list<mixed>|array<string, mixed> $params Query parameters
* @param array<int, int|string|Type|null>|array<string, int|string|Type|null> $types Parameter types
*
* @return mixed|false False is returned if no rows are found.
Expand Down Expand Up @@ -774,7 +774,7 @@ public function quote($value, $type = ParameterType::STRING)
* Prepares and executes an SQL query and returns the result as an array of numeric arrays.
*
* @param string $query SQL query
* @param array<int, mixed>|array<string, mixed> $params Query parameters
* @param list<mixed>|array<string, mixed> $params Query parameters
* @param array<int, int|string|Type|null>|array<string, int|string|Type|null> $types Parameter types
*
* @return list<list<mixed>>
Expand All @@ -794,7 +794,7 @@ 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 string $query SQL query
* @param array<int, mixed>|array<string, mixed> $params Query parameters
* @param list<mixed>|array<string, mixed> $params Query parameters
* @param array<int, int|string|Type|null>|array<string, int|string|Type|null> $types Parameter types
*
* @return list<array<string,mixed>>
Expand All @@ -815,7 +815,7 @@ public function fetchAllAssociative(string $query, array $params = [], array $ty
* mapped to the first column and the values mapped to the second column.
*
* @param string $query SQL query
* @param array<int, mixed>|array<string, mixed> $params Query parameters
* @param list<mixed>|array<string, mixed> $params Query parameters
* @param array<int, int|string|Type|null>|array<string, int|string|Type|null> $types Parameter types
*
* @return array<mixed,mixed>
Expand All @@ -833,7 +833,7 @@ public function fetchAllKeyValue(string $query, array $params = [], array $types
* and their values.
*
* @param string $query SQL query
* @param array<int, mixed>|array<string, mixed> $params Query parameters
* @param list<mixed>|array<string, mixed> $params Query parameters
* @param array<int, int|string>|array<string, int|string> $types Parameter types
*
* @return array<mixed,array<string,mixed>>
Expand All @@ -849,7 +849,7 @@ 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 string $query SQL query
* @param array<int, mixed>|array<string, mixed> $params Query parameters
* @param list<mixed>|array<string, mixed> $params Query parameters
* @param array<int, int|string|Type|null>|array<string, int|string|Type|null> $types Parameter types
*
* @return list<mixed>
Expand All @@ -869,7 +869,7 @@ 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 string $query SQL query
* @param array<int, mixed>|array<string, mixed> $params Query parameters
* @param list<mixed>|array<string, mixed> $params Query parameters
* @param array<int, int|string|Type|null>|array<string, int|string|Type|null> $types Parameter types
*
* @return Traversable<int,list<mixed>>
Expand All @@ -894,7 +894,7 @@ public function iterateNumeric(string $query, array $params = [], array $types =
* as associative arrays.
*
* @param string $query SQL query
* @param array<int, mixed>|array<string, mixed> $params Query parameters
* @param list<mixed>|array<string, mixed> $params Query parameters
* @param array<int, int|string|Type|null>|array<string, int|string|Type|null> $types Parameter types
*
* @return Traversable<int,array<string,mixed>>
Expand All @@ -919,7 +919,7 @@ public function iterateAssociative(string $query, array $params = [], array $typ
* mapped to the first column and the values mapped to the second column.
*
* @param string $query SQL query
* @param array<int, mixed>|array<string, mixed> $params Query parameters
* @param list<mixed>|array<string, mixed> $params Query parameters
* @param array<int, int|string|Type|null>|array<string, int|string|Type|null> $types Parameter types
*
* @return Traversable<mixed,mixed>
Expand All @@ -937,7 +937,7 @@ public function iterateKeyValue(string $query, array $params = [], array $types
* and their values.
*
* @param string $query SQL query
* @param array<int, mixed>|array<string, mixed> $params Query parameters
* @param list<mixed>|array<string, mixed> $params Query parameters
* @param array<int, int|string>|array<string, int|string> $types Parameter types
*
* @return Traversable<mixed,array<string,mixed>>
Expand All @@ -953,7 +953,7 @@ 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 string $query SQL query
* @param array<int, mixed>|array<string, mixed> $params Query parameters
* @param list<mixed>|array<string, mixed> $params Query parameters
* @param array<int, int|string|Type|null>|array<string, int|string|Type|null> $types Parameter types
*
* @return Traversable<int,mixed>
Expand Down Expand Up @@ -992,7 +992,7 @@ public function prepare(string $sql): Statement
* If an SQLLogger is configured, the execution is logged.
*
* @param string $sql SQL query
* @param array<int, mixed>|array<string, mixed> $params Query parameters
* @param list<mixed>|array<string, mixed> $params Query parameters
* @param array<int, int|string|Type|null>|array<string, int|string|Type|null> $types Parameter types
*
* @throws Exception
Expand Down Expand Up @@ -1043,7 +1043,7 @@ public function executeQuery(
* Executes a caching query.
*
* @param string $sql SQL query
* @param array<int, mixed>|array<string, mixed> $params Query parameters
* @param list<mixed>|array<string, mixed> $params Query parameters
* @param array<int, int|string|Type|null>|array<string, int|string|Type|null> $types Parameter types
*
* @throws CacheException
Expand Down Expand Up @@ -1100,7 +1100,7 @@ public function executeCacheQuery($sql, $params, $types, QueryCacheProfile $qcp)
* This method supports PDO binding types as well as DBAL mapping types.
*
* @param string $sql SQL statement
* @param array<int, mixed>|array<string, mixed> $params Statement parameters
* @param list<mixed>|array<string, mixed> $params Statement parameters
* @param array<int, int|string|Type|null>|array<string, int|string|Type|null> $types Parameter types
*
* @return int The number of affected rows.
Expand Down Expand Up @@ -1572,7 +1572,7 @@ public function convertToPHPValue($value, $type)
* or DBAL mapping type, to a given statement.
*
* @param DriverStatement $stmt Prepared statement
* @param array<int, mixed>|array<string, mixed> $params Statement parameters
* @param list<mixed>|array<string, mixed> $params Statement parameters
* @param array<int, int|string|Type|null>|array<string, int|string|Type|null> $types Parameter types
*
* @throws Exception
Expand Down Expand Up @@ -1649,7 +1649,7 @@ public function createQueryBuilder()
/**
* @internal
*
* @param array<int, mixed>|array<string, mixed> $params
* @param list<mixed>|array<string, mixed> $params
* @param array<int, int|string|Type|null>|array<string, int|string|Type|null> $types
*/
final public function convertExceptionDuringQuery(
Expand Down
2 changes: 1 addition & 1 deletion src/Logging/SQLLogger.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ interface SQLLogger
* Logs a SQL statement somewhere.
*
* @param string $sql SQL statement
* @param array<int, mixed>|array<string, mixed>|null $params Statement parameters
* @param list<mixed>|array<string, mixed>|null $params Statement parameters
* @param array<int, Type|int|string|null>|array<string, Type|int|string|null>|null $types Parameter types
*
* @return void
Expand Down
6 changes: 3 additions & 3 deletions src/Query/QueryBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ class QueryBuilder
/**
* The query parameters.
*
* @var array<int, mixed>|array<string, mixed>
* @var list<mixed>|array<string, mixed>
*/
private $params = [];

Expand Down Expand Up @@ -298,7 +298,7 @@ public function setParameter($key, $value, $type = null)
* ));
* </code>
*
* @param array<int, mixed>|array<string, mixed> $params Parameters to set
* @param list<mixed>|array<string, mixed> $params Parameters to set
* @param array<int, int|string|Type|null>|array<string, int|string|Type|null> $types Parameter types
*
* @return $this This QueryBuilder instance.
Expand All @@ -314,7 +314,7 @@ public function setParameters(array $params, array $types = [])
/**
* Gets all defined query parameters for the query being constructed indexed by parameter index or name.
*
* @return array<int, mixed>|array<string, mixed> The currently defined query parameters
* @return list<mixed>|array<string, mixed> The currently defined query parameters
*/
public function getParameters()
{
Expand Down

0 comments on commit 41ff58d

Please sign in to comment.