From f94f24b3a458c00252b48e7c9f1d29210d735394 Mon Sep 17 00:00:00 2001 From: ADmad Date: Wed, 31 Aug 2022 12:59:31 +0530 Subject: [PATCH] Fix array types in docblock. --- Connection.php | 6 +++--- Expression/QueryExpression.php | 4 ++-- Query.php | 2 +- TypeMap.php | 22 +++++++++++----------- TypeMapTrait.php | 4 ++-- 5 files changed, 19 insertions(+), 19 deletions(-) diff --git a/Connection.php b/Connection.php index 81273e33..e54a6930 100644 --- a/Connection.php +++ b/Connection.php @@ -428,7 +428,7 @@ public function getSchemaCollection(): SchemaCollectionInterface * * @param string $table the table to insert values in * @param array $values values to be inserted - * @param array $types list of associative array containing the types to be used for casting + * @param array $types Array containing the types to be used for casting * @return \Cake\Database\StatementInterface */ public function insert(string $table, array $values, array $types = []): StatementInterface @@ -449,7 +449,7 @@ public function insert(string $table, array $values, array $types = []): Stateme * @param string $table the table to update rows from * @param array $values values to be updated * @param array $conditions conditions to be set for update statement - * @param array $types list of associative array containing the types to be used for casting + * @param array $types list of associative array containing the types to be used for casting * @return \Cake\Database\StatementInterface */ public function update(string $table, array $values, array $conditions = [], array $types = []): StatementInterface @@ -467,7 +467,7 @@ public function update(string $table, array $values, array $conditions = [], arr * * @param string $table the table to delete rows from * @param array $conditions conditions to be set for delete statement - * @param array $types list of associative array containing the types to be used for casting + * @param array $types list of associative array containing the types to be used for casting * @return \Cake\Database\StatementInterface */ public function delete(string $table, array $conditions = [], array $types = []): StatementInterface diff --git a/Expression/QueryExpression.php b/Expression/QueryExpression.php index f671fab8..edb67399 100644 --- a/Expression/QueryExpression.php +++ b/Expression/QueryExpression.php @@ -111,7 +111,7 @@ public function getConjunction(): string * be added. When using an array and the key is 'OR' or 'AND' a new expression * object will be created with that conjunction and internal array value passed * as conditions. - * @param array $types Associative array of fields pointing to the type of the + * @param array $types Associative array of fields pointing to the type of the * values that are being passed. Used for correctly binding values to statements. * @see \Cake\Database\Query::where() for examples on conditions * @return $this @@ -702,7 +702,7 @@ public function hasNestedExpression(): bool * representation is wrapped around an adequate instance or of this class. * * @param array $conditions list of conditions to be stored in this object - * @param array $types list of types associated on fields referenced in $conditions + * @param array $types list of types associated on fields referenced in $conditions * @return void */ protected function _addConditions(array $conditions, array $types): void diff --git a/Query.php b/Query.php index 4cc8bc96..98f7bbc1 100644 --- a/Query.php +++ b/Query.php @@ -1646,7 +1646,7 @@ public function unionAll($query, $overwrite = false) * with Query::values(). * * @param array $columns The columns to insert into. - * @param array $types A map between columns & their datatypes. + * @param array $types A map between columns & their datatypes. * @return $this * @throws \RuntimeException When there are 0 columns. */ diff --git a/TypeMap.php b/TypeMap.php index ad3482cb..ac3f8eb8 100644 --- a/TypeMap.php +++ b/TypeMap.php @@ -22,29 +22,29 @@ class TypeMap { /** - * Associative array with the default fields and the related types this query might contain. + * Array with the default fields and the related types this query might contain. * * Used to avoid repetition when calling multiple functions inside this class that * may require a custom type for a specific field. * - * @var array + * @var array */ protected $_defaults = []; /** - * Associative array with the fields and the related types that override defaults this query might contain + * Array with the fields and the related types that override defaults this query might contain * * Used to avoid repetition when calling multiple functions inside this class that * may require a custom type for a specific field. * - * @var array + * @var array */ protected $_types = []; /** * Creates an instance with the given defaults * - * @param array $defaults The defaults to use. + * @param array $defaults The defaults to use. */ public function __construct(array $defaults = []) { @@ -69,7 +69,7 @@ public function __construct(array $defaults = []) * This method will replace all the existing default mappings with the ones provided. * To add into the mappings use `addDefaults()`. * - * @param array $defaults Associative array where keys are field names and values + * @param array $defaults Array where keys are field names / positions and values * are the correspondent type. * @return $this */ @@ -83,7 +83,7 @@ public function setDefaults(array $defaults) /** * Returns the currently configured types. * - * @return array + * @return array */ public function getDefaults(): array { @@ -95,7 +95,7 @@ public function getDefaults(): array * * If a key already exists it will not be overwritten. * - * @param array $types The additional types to add. + * @param array $types The additional types to add. * @return void */ public function addDefaults(array $types): void @@ -114,7 +114,7 @@ public function addDefaults(array $types): void * * This method will replace all the existing type maps with the ones provided. * - * @param array $types Associative array where keys are field names and values + * @param array $types Array where keys are field names / positions and values * are the correspondent type. * @return $this */ @@ -128,7 +128,7 @@ public function setTypes(array $types) /** * Gets a map of fields and their associated types for single-use. * - * @return array + * @return array */ public function getTypes(): array { @@ -151,7 +151,7 @@ public function type($column): ?string /** * Returns an array of all types mapped types * - * @return array + * @return array */ public function toArray(): array { diff --git a/TypeMapTrait.php b/TypeMapTrait.php index d3307093..402a9b5f 100644 --- a/TypeMapTrait.php +++ b/TypeMapTrait.php @@ -66,7 +66,7 @@ public function getTypeMap(): TypeMap * To add a default without overwriting existing ones * use `getTypeMap()->addDefaults()` * - * @param array $types The array of types to set. + * @param array $types The array of types to set. * @return $this * @see \Cake\Database\TypeMap::setDefaults() */ @@ -80,7 +80,7 @@ public function setDefaultTypes(array $types) /** * Gets default types of current type map. * - * @return array + * @return array */ public function getDefaultTypes(): array {