From e3826f8f4dc962181602c478902935a843e75888 Mon Sep 17 00:00:00 2001 From: neznaika0 Date: Wed, 10 Dec 2025 17:31:24 +0300 Subject: [PATCH 1/3] refactor: Update types for `BaseModel`, `Model` and dependencies --- system/BaseModel.php | 434 +++++++------- system/Database/BaseBuilder.php | 4 +- system/Model.php | 254 ++------- tests/system/Models/UpdateModelTest.php | 2 +- .../Models/ValidationModelRuleGroupTest.php | 2 +- tests/system/Models/ValidationModelTest.php | 2 +- user_guide_src/source/changelogs/v4.7.0.rst | 2 + user_guide_src/source/models/model.rst | 4 +- utils/phpstan-baseline/argument.type.neon | 11 +- .../codeigniter.superglobalAccessAssign.neon | 4 +- utils/phpstan-baseline/loader.neon | 2 +- .../method.childReturnType.neon | 15 +- utils/phpstan-baseline/method.notFound.neon | 28 +- .../missingType.callable.neon | 8 +- .../missingType.iterableValue.neon | 536 +++++------------- 15 files changed, 431 insertions(+), 877 deletions(-) diff --git a/system/BaseModel.php b/system/BaseModel.php index 8e81863adfb9..bf879b552276 100644 --- a/system/BaseModel.php +++ b/system/BaseModel.php @@ -19,7 +19,9 @@ use CodeIgniter\Database\Exceptions\DatabaseException; use CodeIgniter\Database\Exceptions\DataException; use CodeIgniter\Database\Query; +use CodeIgniter\DataCaster\Cast\CastInterface; use CodeIgniter\DataConverter\DataConverter; +use CodeIgniter\Entity\Cast\CastInterface as EntityCastInterface; use CodeIgniter\Entity\Entity; use CodeIgniter\Exceptions\InvalidArgumentException; use CodeIgniter\Exceptions\ModelException; @@ -35,7 +37,7 @@ /** * The BaseModel class provides a number of convenient features that * makes working with a databases less painful. Extending this class - * provide means of implementing various database systems + * provide means of implementing various database systems. * * It will: * - simplifies pagination @@ -60,21 +62,22 @@ abstract class BaseModel { /** * Pager instance. - * Populated after calling $this->paginate() + * + * Populated after calling `$this->paginate()`. * * @var Pager */ public $pager; /** - * Database Connection + * Database Connection. * * @var BaseConnection */ protected $db; /** - * Last insert ID + * Last insert ID. * * @var int|string */ @@ -90,14 +93,17 @@ abstract class BaseModel /** * The format that the results should be returned as. - * Will be overridden if the as* methods are used. * - * @var string + * Will be overridden if the `$this->asArray()`, `$this->asObject()` methods are used. + * + * @var 'array'|'object'|class-string */ protected $returnType = 'array'; /** - * Used by asArray() and asObject() to provide + * The temporary format of the result. + * + * Used by `$this->asArray()` and `$this->asObject()` to provide * temporary overrides of model default. * * @var 'array'|'object'|class-string @@ -107,14 +113,14 @@ abstract class BaseModel /** * Array of column names and the type of value to cast. * - * @var array [column => type] + * @var array Array order `['column' => 'type']`. */ protected array $casts = []; /** * Custom convert handlers. * - * @var array [type => classname] + * @var array> Array order `['type' => 'classname']`. */ protected array $castHandlers = []; @@ -122,9 +128,9 @@ abstract class BaseModel /** * Determines whether the model should protect field names during - * mass assignment operations such as insert() and update(). + * mass assignment operations such as $this->insert(), $this->update(). * - * When set to true, only the fields explicitly defined in the $allowedFields + * When set to `true`, only the fields explicitly defined in the `$allowedFields` * property will be allowed for mass assignment. This helps prevent * unintended modification of database fields and improves security * by avoiding mass assignment vulnerabilities. @@ -153,21 +159,19 @@ abstract class BaseModel * The type of column that created_at and updated_at * are expected to. * - * Allowed: 'datetime', 'date', 'int' - * - * @var string + * @var 'date'|'datetime'|'int' */ protected $dateFormat = 'datetime'; /** - * The column used for insert timestamps + * The column used for insert timestamps. * * @var string */ protected $createdField = 'created_at'; /** - * The column used for update timestamps + * The column used for update timestamps. * * @var string */ @@ -183,15 +187,15 @@ abstract class BaseModel protected $useSoftDeletes = false; /** - * Used by withDeleted to override the - * model's softDelete setting. + * Used by $this->withDeleted() to override the + * model's "softDelete" setting. * * @var bool */ protected $tempUseSoftDeletes; /** - * The column used to save soft delete state + * The column used to save soft delete state. * * @var string */ @@ -208,10 +212,10 @@ abstract class BaseModel protected bool $updateOnlyChanged = true; /** - * Rules used to validate data in insert(), update(), save(), - * insertBatch(), and updateBatch() methods. + * Rules used to validate data + * in $this->insert(), $this->update(), $this->save() methods. * - * The array must match the format of data passed to the Validation + * The array must match the format of data passed to the `Validation` * library. * * @see https://codeigniter4.github.io/userguide/models/model.html#setting-validation-rules @@ -224,12 +228,14 @@ abstract class BaseModel * Contains any custom error messages to be * used during data validation. * - * @var array> + * @var array> The column is used as the keys. */ protected $validationMessages = []; /** - * Skip the model's validation. Used in conjunction with skipValidation() + * Skip the model's validation. + * + * Used in conjunction with `$this->skipValidation()` * to skip data validation for any future calls. * * @var bool @@ -265,99 +271,99 @@ abstract class BaseModel */ /** - * Whether to trigger the defined callbacks + * Whether to trigger the defined callbacks. * * @var bool */ protected $allowCallbacks = true; /** - * Used by allowCallbacks() to override the - * model's allowCallbacks setting. + * Used by $this->allowCallbacks() to override the + * model's $allowCallbacks setting. * * @var bool */ protected $tempAllowCallbacks; /** - * Callbacks for beforeInsert + * Callbacks for "beforeInsert" event. * * @var list */ protected $beforeInsert = []; /** - * Callbacks for afterInsert + * Callbacks for "afterInsert" event. * * @var list */ protected $afterInsert = []; /** - * Callbacks for beforeUpdate + * Callbacks for "beforeUpdate" event. * * @var list */ protected $beforeUpdate = []; /** - * Callbacks for afterUpdate + * Callbacks for "afterUpdate" event. * * @var list */ protected $afterUpdate = []; /** - * Callbacks for beforeInsertBatch + * Callbacks for "beforeInsertBatch" event. * * @var list */ protected $beforeInsertBatch = []; /** - * Callbacks for afterInsertBatch + * Callbacks for "afterInsertBatch" event. * * @var list */ protected $afterInsertBatch = []; /** - * Callbacks for beforeUpdateBatch + * Callbacks for "beforeUpdateBatch" event. * * @var list */ protected $beforeUpdateBatch = []; /** - * Callbacks for afterUpdateBatch + * Callbacks for "afterUpdateBatch" event. * * @var list */ protected $afterUpdateBatch = []; /** - * Callbacks for beforeFind + * Callbacks for "beforeFind" event. * * @var list */ protected $beforeFind = []; /** - * Callbacks for afterFind + * Callbacks for "afterFind" event. * * @var list */ protected $afterFind = []; /** - * Callbacks for beforeDelete + * Callbacks for "beforeDelete" event. * * @var list */ protected $beforeDelete = []; /** - * Callbacks for afterDelete + * Callbacks for "afterDelete" event. * * @var list */ @@ -408,23 +414,22 @@ protected function initialize() } /** - * Fetches the row of database. - * This method works only with dbCalls. + * Fetches the row(s) of database with a primary key + * matching $id. + * This method works only with DB calls. * - * @param bool $singleton Single or multiple results - * @param array|int|string|null $id One primary key or an array of primary keys + * @param bool $singleton Single or multiple results. + * @param int|list|string|null $id One primary key or an array of primary keys. * - * @return array|object|null The resulting row of data, or null. + * @return ($singleton is true ? object|row_array|null : list) The resulting row of data or `null`. */ abstract protected function doFind(bool $singleton, $id = null); /** * Fetches the column of database. - * This method works only with dbCalls. + * This method works only with DB calls. * - * @param string $columnName Column Name - * - * @return array|null The resulting row of data, or null if no data found. + * @return list|null The resulting row of data or `null` if no data found. * * @throws DataException */ @@ -432,29 +437,25 @@ abstract protected function doFindColumn(string $columnName); /** * Fetches all results, while optionally limiting them. - * This method works only with dbCalls. - * - * @param int|null $limit Limit - * @param int $offset Offset + * This method works only with DB calls. * - * @return array + * @return list */ abstract protected function doFindAll(?int $limit = null, int $offset = 0); /** * Returns the first row of the result set. - * This method works only with dbCalls. + * This method works only with DB calls. * - * @return array|object|null + * @return object|row_array|null */ abstract protected function doFirst(); /** * Inserts data into the current database. - * This method works only with dbCalls. + * This method works only with DB calls. * - * @param array $row Row data - * @phpstan-param row_array $row + * @param row_array $row * * @return bool */ @@ -462,68 +463,68 @@ abstract protected function doInsert(array $row); /** * Compiles batch insert and runs the queries, validating each row prior. - * This method works only with dbCalls. + * This method works only with DB calls. * - * @param array|null $set An associative array of insert values - * @param bool|null $escape Whether to escape values - * @param int $batchSize The size of the batch to run - * @param bool $testing True means only number of records is returned, false will execute the query + * @param list|null $set An associative array of insert values. + * @param bool|null $escape Whether to escape values. + * @param int $batchSize The size of the batch to run. + * @param bool $testing `true` means only number of records is returned, `false` will execute the query. * - * @return bool|int Number of rows inserted or FALSE on failure + * @return false|int|list Number of rows affected or `false` on failure, SQL array when test mode */ abstract protected function doInsertBatch(?array $set = null, ?bool $escape = null, int $batchSize = 100, bool $testing = false); /** * Updates a single record in the database. - * This method works only with dbCalls. + * This method works only with DB calls. * - * @param array|int|string|null $id ID - * @param array|null $row Row data - * @phpstan-param row_array|null $row + * @param int|list|string|null $id + * @param row_array|null $row */ abstract protected function doUpdate($id = null, $row = null): bool; /** * Compiles an update and runs the query. - * This method works only with dbCalls. + * This method works only with DB calls. * - * @param array|null $set An associative array of update values - * @param string|null $index The where key - * @param int $batchSize The size of the batch to run - * @param bool $returnSQL True means SQL is returned, false will execute the query + * @param list|null $set An associative array of update values. + * @param string|null $index The where key. + * @param int $batchSize The size of the batch to run. + * @param bool $returnSQL `true` means SQL is returned, `false` will execute the query. * - * @return false|int|list Number of rows affected or FALSE on failure, SQL array when testMode + * @return false|int|list Number of rows affected or `false` on failure, SQL array when test mode * * @throws DatabaseException */ abstract protected function doUpdateBatch(?array $set = null, ?string $index = null, int $batchSize = 100, bool $returnSQL = false); /** - * Deletes a single record from the database where $id matches. - * This method works only with dbCalls. + * Deletes a single record from the database where $id matches + * the table's primary key. + * This method works only with DB calls. * - * @param array|int|string|null $id The rows primary key(s) - * @param bool $purge Allows overriding the soft deletes setting. + * @param int|list|string|null $id The rows primary key(s). + * @param bool $purge Allows overriding the soft deletes setting. * - * @return bool|string + * @return bool|string Returns a SQL string if in test mode. * * @throws DatabaseException */ abstract protected function doDelete($id = null, bool $purge = false); /** - * Permanently deletes all rows that have been marked as deleted. - * through soft deletes (deleted = 1). - * This method works only with dbCalls. + * Permanently deletes all rows that have been marked as deleted + * through soft deletes (value of column $deletedField is not null). + * This method works only with DB calls. * - * @return bool|string Returns a string if in test mode. + * @return bool|string Returns a SQL string if in test mode. */ abstract protected function doPurgeDeleted(); /** - * Works with the find* methods to return only the rows that - * have been deleted. - * This method works only with dbCalls. + * Works with the $this->find* methods to return only the rows that + * have been deleted (value of column $deletedField is not null). + * This method works only with DB calls. * * @return void */ @@ -531,10 +532,10 @@ abstract protected function doOnlyDeleted(); /** * Compiles a replace and runs the query. - * This method works only with dbCalls. + * This method works only with DB calls. * - * @param row_array|null $row Row data - * @param bool $returnSQL Set to true to return Query String + * @param row_array|null $row + * @param bool $returnSQL `true` means SQL is returned, `false` will execute the query. * * @return BaseResult|false|Query|string */ @@ -542,39 +543,40 @@ abstract protected function doReplace(?array $row = null, bool $returnSQL = fals /** * Grabs the last error(s) that occurred from the Database connection. - * This method works only with dbCalls. + * This method works only with DB calls. * * @return array */ abstract protected function doErrors(); /** - * Public getter to return the id value using the idValue() method. - * For example with SQL this will return $data->$this->primaryKey. + * Public getter to return the ID value for the data array or object. + * For example with SQL this will return `$data->{$this->primaryKey}`. * - * @param object|row_array $row Row data + * @param object|row_array $row * - * @return array|int|string|null + * @return int|string|null */ abstract public function getIdValue($row); /** * Override countAllResults to account for soft deleted accounts. - * This method works only with dbCalls. + * This method works only with DB calls. * - * @param bool $reset Reset - * @param bool $test Test + * @param bool $reset When `false`, the `$tempUseSoftDeletes` will be + * dependent on `$useSoftDeletes` value because we don't + * want to add the same "where" condition for the second time. + * @param bool $test `true` returns the number of all records, `false` will execute the query. * - * @return int|string + * @return int|string Returns a SQL string if in test mode. */ abstract public function countAllResults(bool $reset = true, bool $test = false); /** * Loops over records in batches, allowing you to operate on them. - * This method works only with dbCalls. + * This method works only with DB calls. * - * @param int $size Size - * @param Closure(array|object): mixed $userFunc Callback Function + * @param Closure(array|object): mixed $userFunc * * @return void * @@ -585,10 +587,9 @@ abstract public function chunk(int $size, Closure $userFunc); /** * Fetches the row of database. * - * @param array|int|string|null $id One primary key or an array of primary keys + * @param int|list|string|null $id One primary key or an array of primary keys. * - * @return array|object|null The resulting row of data, or null. - * @phpstan-return ($id is int|string ? row_array|object|null : list) + * @return ($id is int|string ? object|row_array|null : list) */ public function find($id = null) { @@ -628,9 +629,7 @@ public function find($id = null) /** * Fetches the column of database. * - * @param string $columnName Column Name - * - * @return array|null The resulting row of data, or null if no data found. + * @return list|object|string|null>|null The resulting row of data, or `null` if no data found. * * @throws DataException */ @@ -648,10 +647,7 @@ public function findColumn(string $columnName) /** * Fetches all results, while optionally limiting them. * - * @param int $limit Limit - * @param int $offset Offset - * - * @return array + * @return list */ public function findAll(?int $limit = null, int $offset = 0) { @@ -696,7 +692,7 @@ public function findAll(?int $limit = null, int $offset = 0) /** * Returns the first row of the result set. * - * @return array|object|null + * @return object|row_array|null */ public function first() { @@ -731,12 +727,14 @@ public function first() /** * A convenience method that will attempt to determine whether the - * data should be inserted or updated. Will work with either - * an array or object. When using with custom class objects, + * data should be inserted or updated. + * + * Will work with either an array or object. + * When using with custom class objects, * you must ensure that the class will provide access to the class * variables, even if through a magic method. * - * @param object|row_array $row Row data + * @param object|row_array $row * * @throws ReflectionException */ @@ -761,10 +759,9 @@ public function save($row): bool /** * This method is called on save to determine if entry have to be updated. - * If this method returns false insert operation will be executed + * If this method returns `false` insert operation will be executed. * - * @param array|object $row Row data - * @phpstan-param row_array|object $row + * @param object|row_array $row */ protected function shouldUpdate($row): bool { @@ -787,7 +784,7 @@ public function getInsertID() * Inserts data into the database. If an object is provided, * it will attempt to convert it to an array. * - * @param object|row_array|null $row Row data + * @param object|row_array|null $row * @param bool $returnID Whether insert ID should be returned or not. * * @return ($returnID is true ? false|int|string : bool) @@ -864,7 +861,9 @@ public function insert($row = null, bool $returnID = true) * Set datetime to created field. * * @param row_array $row - * @param int|string $date timestamp or datetime string + * @param int|string $date Timestamp or datetime string. + * + * @return row_array */ protected function setCreatedField(array $row, $date): array { @@ -879,7 +878,9 @@ protected function setCreatedField(array $row, $date): array * Set datetime to updated field. * * @param row_array $row - * @param int|string $date timestamp or datetime string + * @param int|string $date Timestamp or datetime string + * + * @return row_array */ protected function setUpdatedField(array $row, $date): array { @@ -893,12 +894,12 @@ protected function setUpdatedField(array $row, $date): array /** * Compiles batch insert runs the queries, validating each row prior. * - * @param list|null $set an associative array of insert values - * @param bool|null $escape Whether to escape values - * @param int $batchSize The size of the batch to run - * @param bool $testing True means only number of records is returned, false will execute the query + * @param list|null $set An associative array of insert values. + * @param bool|null $escape Whether to escape values. + * @param int $batchSize The size of the batch to run. + * @param bool $testing `true` means only number of records is returned, `false` will execute the query. * - * @return bool|int Number of rows inserted or FALSE on failure + * @return false|int|list Number of rows inserted or `false` on failure. * * @throws ReflectionException */ @@ -961,9 +962,8 @@ public function insertBatch(?array $set = null, ?bool $escape = null, int $batch * Updates a single record in the database. If an object is provided, * it will attempt to convert it into an array. * - * @param array|int|string|null $id - * @param array|object|null $row Row data - * @phpstan-param row_array|object|null $row + * @param int|list|string|null $id + * @param object|row_array|null $row * * @throws ReflectionException */ @@ -973,7 +973,8 @@ public function update($id = null, $row = null): bool throw new InvalidArgumentException('update(): argument #1 ($id) should not be boolean.'); } - if (is_numeric($id) || is_string($id)) { + // if (is_numeric($id) || is_string($id)) { + if (! in_array($id, [null, 0, '0'], true) && (is_numeric($id) || is_string($id))) { $id = [$id]; } @@ -1023,12 +1024,12 @@ public function update($id = null, $row = null): bool /** * Compiles an update and runs the query. * - * @param list|null $set an associative array of insert values - * @param string|null $index The where key - * @param int $batchSize The size of the batch to run - * @param bool $returnSQL True means SQL is returned, false will execute the query + * @param list|null $set An associative array of insert values. + * @param string|null $index The where key. + * @param int $batchSize The size of the batch to run. + * @param bool $returnSQL `true` means SQL is returned, `false` will execute the query. * - * @return false|int|list Number of rows affected or FALSE on failure, SQL array when testMode + * @return false|int|list Number of rows affected or `false` on failure, SQL array when test mode. * * @throws DatabaseException * @throws ReflectionException @@ -1091,10 +1092,10 @@ public function updateBatch(?array $set = null, ?string $index = null, int $batc /** * Deletes a single record from the database where $id matches. * - * @param int|list|string|null $id The rows primary key(s) + * @param int|list|string|null $id The rows primary key(s). * @param bool $purge Allows overriding the soft deletes setting. * - * @return BaseResult|bool + * @return bool|string Returns a SQL string if in test mode. * * @throws DatabaseException */ @@ -1135,9 +1136,9 @@ public function delete($id = null, bool $purge = false) /** * Permanently deletes all rows that have been marked as deleted - * through soft deletes (deleted = 1). + * through soft deletes (value of column $deletedField is not null). * - * @return bool|string Returns a string if in test mode. + * @return bool|string Returns a SQL string if in test mode. */ public function purgeDeleted() { @@ -1152,8 +1153,6 @@ public function purgeDeleted() * Sets $useSoftDeletes value so that we can temporarily override * the soft deletes settings. Can be used for all find* methods. * - * @param bool $val Value - * * @return $this */ public function withDeleted(bool $val = true) @@ -1164,7 +1163,7 @@ public function withDeleted(bool $val = true) } /** - * Works with the find* methods to return only the rows that + * Works with the $this->find* methods to return only the rows that * have been deleted. * * @return $this @@ -1180,8 +1179,8 @@ public function onlyDeleted() /** * Compiles a replace and runs the query. * - * @param row_array|null $row Row data - * @param bool $returnSQL Set to true to return Query String + * @param row_array|null $row + * @param bool $returnSQL `true` means SQL is returned, `false` will execute the query. * * @return BaseResult|false|Query|string */ @@ -1200,14 +1199,15 @@ public function replace(?array $row = null, bool $returnSQL = false) } /** - * Grabs the last error(s) that occurred. If data was validated, - * it will first check for errors there, otherwise will try to - * grab the last error from the Database connection. + * Grabs the last error(s) that occurred. + * + * If data was validated, it will first check for errors there, + * otherwise will try to grab the last error from the Database connection. * * The return array should be in the following format: - * ['source' => 'message'] + * `['source' => 'message']`. * - * @param bool $forceDB Always grab the db error, not validation + * @param bool $forceDB Always grab the DB error, not validation. * * @return array */ @@ -1230,12 +1230,12 @@ public function errors(bool $forceDB = false) * Expects a GET variable (?page=2) that specifies the page of results * to display. * - * @param int|null $perPage Items per page + * @param int|null $perPage Items per page. * @param string $group Will be used by the pagination library to identify a unique pagination set. - * @param int|null $page Optional page number (useful when the page number is provided in different way) - * @param int $segment Optional URI segment number (if page number is provided by URI segment) + * @param int|null $page Optional page number (useful when the page number is provided in different way). + * @param int $segment Optional URI segment number (if page number is provided by URI segment). * - * @return array|null + * @return list */ public function paginate(?int $perPage = null, string $group = 'default', ?int $page = null, int $segment = 0) { @@ -1258,7 +1258,7 @@ public function paginate(?int $perPage = null, string $group = 'default', ?int $ /** * It could be used when you have to change default or override current allowed fields. * - * @param array $allowedFields Array with names of fields + * @param list $allowedFields Array with names of fields. * * @return $this */ @@ -1273,8 +1273,6 @@ public function setAllowedFields(array $allowedFields) * Sets whether or not we should whitelist data set during * updates or inserts against $this->availableFields. * - * @param bool $protect Value - * * @return $this */ public function protect(bool $protect = true) @@ -1291,8 +1289,9 @@ public function protect(bool $protect = true) * @used-by update() to protect against mass assignment vulnerabilities. * @used-by updateBatch() to protect against mass assignment vulnerabilities. * - * @param array $row Row data - * @phpstan-param row_array $row + * @param row_array $row + * + * @return row_array * * @throws DataException */ @@ -1322,8 +1321,9 @@ protected function doProtectFields(array $row): array * @used-by insert() to protect against mass assignment vulnerabilities. * @used-by insertBatch() to protect against mass assignment vulnerabilities. * - * @param array $row Row data - * @phpstan-param row_array $row + * @param row_array $row + * + * @return row_array * * @throws DataException */ @@ -1333,17 +1333,17 @@ protected function doProtectFieldsForInsert(array $row): array } /** - * Sets the date or current date if null value is passed. + * Sets the timestamp or current timestamp if null value is passed. * - * @param int|null $userData An optional PHP timestamp to be converted. + * @param int|null $userDate An optional PHP timestamp to be converted * * @return int|string * * @throws ModelException */ - protected function setDate(?int $userData = null) + protected function setDate(?int $userDate = null) { - $currentDate = $userData ?? Time::now()->getTimestamp(); + $currentDate = $userDate ?? Time::now()->getTimestamp(); return $this->intToDate($currentDate); } @@ -1355,12 +1355,10 @@ protected function setDate(?int $userData = null) * used by inheriting classes. * * The available time formats are: - * - 'int' - Stores the date as an integer timestamp - * - 'datetime' - Stores the data in the SQL datetime format + * - 'int' - Stores the date as an integer timestamp. + * - 'datetime' - Stores the data in the SQL datetime format. * - 'date' - Stores the date (only) in the SQL date format. * - * @param int $value value - * * @return int|string * * @throws ModelException @@ -1379,12 +1377,10 @@ protected function intToDate(int $value) * Converts Time value to string using $this->dateFormat. * * The available time formats are: - * - 'int' - Stores the date as an integer timestamp - * - 'datetime' - Stores the data in the SQL datetime format + * - 'int' - Stores the date as an integer timestamp. + * - 'datetime' - Stores the data in the SQL datetime format. * - 'date' - Stores the date (only) in the SQL date format. * - * @param Time $value value - * * @return int|string */ protected function timeToDate(Time $value) @@ -1398,9 +1394,7 @@ protected function timeToDate(Time $value) } /** - * Set the value of the skipValidation flag. - * - * @param bool $skip Value + * Set the value of the $skipValidation flag. * * @return $this */ @@ -1415,7 +1409,7 @@ public function skipValidation(bool $skip = true) * Allows to set (and reset) validation messages. * It could be used when you have to change default or override current validate messages. * - * @param array $validationMessages Value + * @param array> $validationMessages * * @return $this */ @@ -1430,8 +1424,7 @@ public function setValidationMessages(array $validationMessages) * Allows to set field wise validation message. * It could be used when you have to change default or override current validate messages. * - * @param string $field Field Name - * @param array $fieldMessages Validation messages + * @param array $fieldMessages * * @return $this */ @@ -1446,7 +1439,7 @@ public function setValidationMessage(string $field, array $fieldMessages) * Allows to set (and reset) validation rules. * It could be used when you have to change default or override current validate rules. * - * @param array|string>|string> $validationRules Value + * @param array|string>|string> $validationRules * * @return $this */ @@ -1461,8 +1454,7 @@ public function setValidationRules(array $validationRules) * Allows to set field wise validation rules. * It could be used when you have to change default or override current validate rules. * - * @param string $field Field Name - * @param array|string $fieldRules Validation rules + * @param array|string>|string $fieldRules * * @return $this */ @@ -1490,8 +1482,6 @@ public function setValidationRule(string $field, $fieldRules) * Should validation rules be removed before saving? * Most handy when doing updates. * - * @param bool $choice Value - * * @return $this */ public function cleanRules(bool $choice = false) @@ -1505,8 +1495,7 @@ public function cleanRules(bool $choice = false) * Validate the row data against the validation rules (or the validation group) * specified in the class property, $validationRules. * - * @param array|object $row Row data - * @phpstan-param row_array|object $row + * @param object|row_array $row */ public function validate($row): bool { @@ -1548,7 +1537,9 @@ public function validate($row): bool * Returns the model's defined validation rules so that they * can be used elsewhere, if needed. * - * @param array $options Options + * @param array{only?: list, except?: list} $options Filter the list of rules + * + * @return array|string>|string> */ public function getValidationRules(array $options = []): array { @@ -1583,6 +1574,8 @@ protected function ensureValidation(): void /** * Returns the model's validation messages, so they * can be used elsewhere, if needed. + * + * @return array> */ public function getValidationMessages(): array { @@ -1594,13 +1587,14 @@ public function getValidationMessages(): array * currently so that rules don't block updating when only updating * a partial row. * - * @param array $rules Array containing field name and rule - * @param array $row Row data (@TODO Remove null in param type) - * @phpstan-param row_array $row + * @param array|string>|string> $rules + * @param row_array $row + * + * @return array|string>|string> */ - protected function cleanValidationRules(array $rules, ?array $row = null): array + protected function cleanValidationRules(array $rules, array $row): array { - if ($row === null || $row === []) { + if ($row === []) { return []; } @@ -1617,8 +1611,6 @@ protected function cleanValidationRules(array $rules, ?array $row = null): array * Sets $tempAllowCallbacks value so that we can temporarily override * the setting. Resets after the next method that uses triggers. * - * @param bool $val value - * * @return $this */ public function allowCallbacks(bool $val = true) @@ -1643,10 +1635,12 @@ public function allowCallbacks(bool $val = true) * * If callbacks are not allowed then returns $eventData immediately. * - * @param string $event Event - * @param array $eventData Event Data + * @template TEventData of array * - * @return array + * @param string $event Valid property of the model event: $this->before*, $this->after*, etc. + * @param TEventData $eventData + * + * @return TEventData * * @throws DataException */ @@ -1686,7 +1680,7 @@ public function asArray() * class vars with the same name as the collection columns, * or at least allows them to be created. * - * @param 'object'|class-string $class Class Name + * @param 'object'|class-string $class * * @return $this */ @@ -1700,12 +1694,12 @@ public function asObject(string $class = 'object') /** * Takes a class and returns an array of its public and protected * properties as an array suitable for use in creates and updates. - * This method uses objectToRawArray() internally and does conversion - * to string on all Time instances + * This method uses `$this->objectToRawArray()` internally and does conversion + * to string on all Time instances. * - * @param object $object Object - * @param bool $onlyChanged Only Changed Property - * @param bool $recursive If true, inner entities will be cast as array as well + * @param object $object + * @param bool $onlyChanged Returns only the changed properties. + * @param bool $recursive If `true`, inner entities will be cast as array as well. * * @return array * @@ -1745,17 +1739,17 @@ protected function timeToString(array $properties): array * Takes a class and returns an array of its public and protected * properties as an array with raw values. * - * @param object $object Object - * @param bool $onlyChanged Only Changed Property - * @param bool $recursive If true, inner entities will be casted as array as well + * @param object $object + * @param bool $onlyChanged Returns only the changed properties. + * @param bool $recursive If `true`, inner entities will be cast as array as well. * - * @return array Array with raw values. + * @return array Array with raw values * * @throws ReflectionException */ protected function objectToRawArray($object, bool $onlyChanged = true, bool $recursive = false): array { - // Entity::toRawArray() returns array. + // Entity::toRawArray() returns array if (method_exists($object, 'toRawArray')) { $properties = $object->toRawArray($onlyChanged, $recursive); } else { @@ -1765,7 +1759,7 @@ protected function objectToRawArray($object, bool $onlyChanged = true, bool $rec $properties = []; // Loop over each property, - // saving the name/value in a new array we can return. + // saving the name/value in a new array we can return foreach ($props as $prop) { $properties[$prop->getName()] = $prop->getValue($object); } @@ -1777,8 +1771,9 @@ protected function objectToRawArray($object, bool $onlyChanged = true, bool $rec /** * Transform data to array. * - * @param object|row_array|null $row Row data - * @param string $type Type of data (insert|update) + * @param object|row_array|null $row + * + * @return array * * @throws DataException * @throws InvalidArgumentException @@ -1842,11 +1837,9 @@ protected function transformDataToArray($row, string $type): array } /** - * Provides the db connection and model's properties. - * - * @param string $name Name + * Provides the DB connection and model's properties. * - * @return array|bool|float|int|object|string|null + * @return mixed */ public function __get(string $name) { @@ -1858,9 +1851,7 @@ public function __get(string $name) } /** - * Checks for the existence of properties across this model, and db connection. - * - * @param string $name Name + * Checks for the existence of properties across this model, and DB connection. */ public function __isset(string $name): bool { @@ -1874,10 +1865,9 @@ public function __isset(string $name): bool /** * Provides direct access to method in the database connection. * - * @param string $name Name - * @param array $params Params + * @param array $params * - * @return $this|null + * @return mixed */ public function __call(string $name, array $params) { @@ -1901,8 +1891,10 @@ public function allowEmptyInserts(bool $value = true): self /** * Converts database data array to return type value. * - * @param array $row Raw data from database + * @param array $row Raw data from database. * @param 'array'|'object'|class-string $returnType + * + * @return array|object */ protected function convertToReturnType(array $row, string $returnType): array|object { diff --git a/system/Database/BaseBuilder.php b/system/Database/BaseBuilder.php index fd33bf40a566..f38d52dc9750 100644 --- a/system/Database/BaseBuilder.php +++ b/system/Database/BaseBuilder.php @@ -947,8 +947,8 @@ public function orHavingNotIn(?string $key = null, $values = null, ?bool $escape * @used-by whereNotIn() * @used-by orWhereNotIn() * - * @param non-empty-string|null $key - * @param array|BaseBuilder|(Closure(BaseBuilder): BaseBuilder)|null $values The values searched on, or anonymous function with subquery + * @param non-empty-string|null $key + * @param BaseBuilder|(Closure(BaseBuilder): BaseBuilder)|list|null $values The values searched on, or anonymous function with subquery * * @return $this * diff --git a/system/Model.php b/system/Model.php index 60759b9e201f..8f6888a69951 100644 --- a/system/Model.php +++ b/system/Model.php @@ -16,18 +16,15 @@ use Closure; use CodeIgniter\Database\BaseBuilder; use CodeIgniter\Database\BaseConnection; -use CodeIgniter\Database\BaseResult; use CodeIgniter\Database\ConnectionInterface; use CodeIgniter\Database\Exceptions\DatabaseException; use CodeIgniter\Database\Exceptions\DataException; -use CodeIgniter\Database\Query; use CodeIgniter\Entity\Entity; use CodeIgniter\Exceptions\BadMethodCallException; use CodeIgniter\Exceptions\ModelException; use CodeIgniter\Validation\ValidationInterface; use Config\Database; use Config\Feature; -use ReflectionException; use stdClass; /** @@ -91,7 +88,7 @@ class Model extends BaseModel { /** - * Name of database table + * Name of database table. * * @var string */ @@ -112,7 +109,7 @@ class Model extends BaseModel protected $useAutoIncrement = true; /** - * Query Builder object + * Query Builder object. * * @var BaseBuilder|null */ @@ -123,8 +120,7 @@ class Model extends BaseModel * so that we can capture it (not the builder) * and ensure it gets validated first. * - * @var array{escape: array, data: array}|array{} - * @phpstan-var array{escape: array, data: row_array}|array{} + * @var array{escape: array, data: row_array}|array{} */ protected $tempData = []; @@ -132,14 +128,14 @@ class Model extends BaseModel * Escape array that maps usage of escape * flag for every parameter. * - * @var array + * @var array */ protected $escape = []; /** * Builder method names that should not be used in the Model. * - * @var list method name + * @var list */ private array $builderMethodsNotAvailable = [ 'getCompiledInsert', @@ -160,9 +156,7 @@ public function __construct(?ConnectionInterface $db = null, ?ValidationInterfac } /** - * Specify the table associated with a model - * - * @param string $table Table + * Specify the table associated with a model. * * @return $this */ @@ -173,22 +167,11 @@ public function setTable(string $table) return $this; } - /** - * Fetches the row(s) of database from $this->table with a primary key - * matching $id. - * This method works only with dbCalls. - * - * @param bool $singleton Single or multiple results - * @param array|int|string|null $id One primary key or an array of primary keys - * - * @return array|object|null The resulting row of data, or null. - * @phpstan-return ($singleton is true ? row_array|null|object : list) - */ protected function doFind(bool $singleton, $id = null) { $builder = $this->builder(); - $useCast = $this->useCasts(); + if ($useCast) { $returnType = $this->tempReturnType; $this->asArray(); @@ -238,30 +221,15 @@ protected function doFind(bool $singleton, $id = null) return $rows; } - /** - * Fetches the column of database from $this->table. - * This method works only with dbCalls. - * - * @param string $columnName Column Name - * - * @return array|null The resulting row of data, or null if no data found. - * @phpstan-return list|null - */ protected function doFindColumn(string $columnName) { return $this->select($columnName)->asArray()->find(); } /** - * Works with the current Query Builder instance to return - * all results, while optionally limiting them. - * This method works only with dbCalls. - * - * @param int|null $limit Limit - * @param int $offset Offset + * {@inheritDoc} * - * @return array - * @phpstan-return list + * Works with the current Query Builder instance. */ protected function doFindAll(?int $limit = null, int $offset = 0) { @@ -298,12 +266,10 @@ protected function doFindAll(?int $limit = null, int $offset = 0) } /** - * Returns the first row of the result set. Will take any previous - * Query Builder calls into account when determining the result set. - * This method works only with dbCalls. + * {@inheritDoc} * - * @return array|object|null - * @phpstan-return row_array|object|null + * Will take any previous Query Builder calls into account + * when determining the result set. */ protected function doFirst() { @@ -338,15 +304,6 @@ protected function doFirst() return $row; } - /** - * Inserts data into the current table. - * This method works only with dbCalls. - * - * @param array $row Row data - * @phpstan-param row_array $row - * - * @return bool - */ protected function doInsert(array $row) { $escape = $this->escape; @@ -402,24 +359,13 @@ protected function doInsert(array $row) return $result; } - /** - * Compiles batch insert strings and runs the queries, validating each row prior. - * This method works only with dbCalls. - * - * @param array|null $set An associative array of insert values - * @param bool|null $escape Whether to escape values - * @param int $batchSize The size of the batch to run - * @param bool $testing True means only number of records is returned, false will execute the query - * - * @return bool|int Number of rows inserted or FALSE on failure - */ protected function doInsertBatch(?array $set = null, ?bool $escape = null, int $batchSize = 100, bool $testing = false) { - if (is_array($set)) { + if (is_array($set) && ! $this->useAutoIncrement) { foreach ($set as $row) { - // Require non-empty primaryKey when + // Require non-empty $primaryKey when // not using auto-increment feature - if (! $this->useAutoIncrement && ! isset($row[$this->primaryKey])) { + if (! isset($row[$this->primaryKey])) { throw DataException::forEmptyPrimaryKey('insertBatch'); } } @@ -428,14 +374,6 @@ protected function doInsertBatch(?array $set = null, ?bool $escape = null, int $ return $this->builder()->testMode($testing)->insertBatch($set, $escape, $batchSize); } - /** - * Updates a single record in $this->table. - * This method works only with dbCalls. - * - * @param array|int|string|null $id - * @param array|null $row Row data - * @phpstan-param row_array|null $row - */ protected function doUpdate($id = null, $row = null): bool { $escape = $this->escape; @@ -461,36 +399,11 @@ protected function doUpdate($id = null, $row = null): bool return $builder->update(); } - /** - * Compiles an update string and runs the query - * This method works only with dbCalls. - * - * @param array|null $set An associative array of update values - * @param string|null $index The where key - * @param int $batchSize The size of the batch to run - * @param bool $returnSQL True means SQL is returned, false will execute the query - * - * @return false|int|list Number of rows affected or FALSE on failure, SQL array when testMode - * - * @throws DatabaseException - */ protected function doUpdateBatch(?array $set = null, ?string $index = null, int $batchSize = 100, bool $returnSQL = false) { return $this->builder()->testMode($returnSQL)->updateBatch($set, $index, $batchSize); } - /** - * Deletes a single record from $this->table where $id matches - * the table's primaryKey - * This method works only with dbCalls. - * - * @param array|int|string|null $id The rows primary key(s) - * @param bool $purge Allows overriding the soft deletes setting. - * - * @return bool|string SQL string when testMode - * - * @throws DatabaseException - */ protected function doDelete($id = null, bool $purge = false) { $set = []; @@ -521,13 +434,6 @@ protected function doDelete($id = null, bool $purge = false) return $builder->delete(); } - /** - * Permanently deletes all rows that have been marked as deleted - * through soft deletes (deleted = 1) - * This method works only with dbCalls. - * - * @return bool|string Returns a SQL string if in test mode. - */ protected function doPurgeDeleted() { return $this->builder() @@ -535,39 +441,22 @@ protected function doPurgeDeleted() ->delete(); } - /** - * Works with the find* methods to return only the rows that - * have been deleted. - * This method works only with dbCalls. - * - * @return void - */ protected function doOnlyDeleted() { $this->builder()->where($this->table . '.' . $this->deletedField . ' IS NOT NULL'); } - /** - * Compiles a replace into string and runs the query - * This method works only with dbCalls. - * - * @param row_array|null $row Data - * @param bool $returnSQL Set to true to return Query String - * - * @return BaseResult|false|Query|string - */ protected function doReplace(?array $row = null, bool $returnSQL = false) { return $this->builder()->testMode($returnSQL)->replace($row); } /** - * Grabs the last error(s) that occurred from the Database connection. + * {@inheritDoc} + * * The return array should be in the following format: - * ['source' => 'message'] + * `['source' => 'message']`. * This method works only with dbCalls. - * - * @return array */ protected function doErrors() { @@ -581,14 +470,6 @@ protected function doErrors() return [$this->db::class => $error['message']]; } - /** - * Returns the id value for the data array or object - * - * @param array|object $row Row data - * @phpstan-param row_array|object $row - * - * @return array|int|string|null - */ public function getIdValue($row) { if (is_object($row)) { @@ -619,9 +500,23 @@ public function getIdValue($row) return null; } + public function countAllResults(bool $reset = true, bool $test = false) + { + if ($this->tempUseSoftDeletes) { + $this->builder()->where($this->table . '.' . $this->deletedField, null); + } + + $this->tempUseSoftDeletes = $reset + ? $this->useSoftDeletes + : ($this->useSoftDeletes ? false : $this->useSoftDeletes); + + return $this->builder()->testMode($test)->countAllResults($reset); + } + /** - * Loops over records in batches, allowing you to operate on them. - * Works with $this->builder to get the Compiled select to + * {@inheritDoc} + * + * Works with `$this->builder` to get the Compiled select to * determine the rows to operate on. * This method works only with dbCalls. */ @@ -654,27 +549,6 @@ public function chunk(int $size, Closure $userFunc) } } - /** - * Override countAllResults to account for soft deleted accounts. - * - * @return int|string - */ - public function countAllResults(bool $reset = true, bool $test = false) - { - if ($this->tempUseSoftDeletes) { - $this->builder()->where($this->table . '.' . $this->deletedField, null); - } - - // When $reset === false, the $tempUseSoftDeletes will be - // dependent on $useSoftDeletes value because we don't - // want to add the same "where" condition for the second time - $this->tempUseSoftDeletes = $reset - ? $this->useSoftDeletes - : ($this->useSoftDeletes ? false : $this->useSoftDeletes); - - return $this->builder()->testMode($test)->countAllResults($reset); - } - /** * Provides a shared instance of the Query Builder. * @@ -725,7 +599,7 @@ public function builder(?string $table = null) * data here. This allows it to be used with any of the other * builder methods and still get validated data, like replace. * - * @param array|object|string $key Field name, or an array of field/value pairs, or an object + * @param object|row_array|string $key Field name, or an array of field/value pairs, or an object * @param bool|float|int|object|string|null $value Field value, if $key is a single field * @param bool|null $escape Whether to escape values * @@ -748,12 +622,6 @@ public function set($key, $value = '', ?bool $escape = null) return $this; } - /** - * This method is called on save to determine if entry have to be updated - * If this method return false insert operation will be executed - * - * @param array|object $row Data - */ protected function shouldUpdate($row): bool { if (parent::shouldUpdate($row) === false) { @@ -769,17 +637,6 @@ protected function shouldUpdate($row): bool return $this->where($this->primaryKey, $this->getIdValue($row))->countAllResults() === 1; } - /** - * Inserts data into the database. If an object is provided, - * it will attempt to convert it to an array. - * - * @param object|row_array|null $row - * @param bool $returnID Whether insert ID should be returned or not. - * - * @return ($returnID is true ? false|int|string : bool) - * - * @throws ReflectionException - */ public function insert($row = null, bool $returnID = true) { if (isset($this->tempData['data'])) { @@ -797,18 +654,6 @@ public function insert($row = null, bool $returnID = true) return parent::insert($row, $returnID); } - /** - * Ensures that only the fields that are allowed to be inserted are in - * the data array. - * - * @used-by insert() to protect against mass assignment vulnerabilities. - * @used-by insertBatch() to protect against mass assignment vulnerabilities. - * - * @param array $row Row data - * @phpstan-param row_array $row - * - * @throws DataException - */ protected function doProtectFieldsForInsert(array $row): array { if (! $this->protectFields) { @@ -833,16 +678,6 @@ protected function doProtectFieldsForInsert(array $row): array return $row; } - /** - * Updates a single record in the database. If an object is provided, - * it will attempt to convert it into an array. - * - * @param array|int|string|null $id - * @param array|object|null $row - * @phpstan-param row_array|object|null $row - * - * @throws ReflectionException - */ public function update($id = null, $row = null): bool { if (isset($this->tempData['data'])) { @@ -860,17 +695,6 @@ public function update($id = null, $row = null): bool return parent::update($id, $row); } - /** - * Takes a class and returns an array of its public and protected - * properties as an array with raw values. - * - * @param object $object Object - * @param bool $recursive If true, inner entities will be cast as array as well - * - * @return array Array with raw values. - * - * @throws ReflectionException - */ protected function objectToRawArray($object, bool $onlyChanged = true, bool $recursive = false): array { return parent::objectToRawArray($object, $onlyChanged); @@ -879,9 +703,7 @@ protected function objectToRawArray($object, bool $onlyChanged = true, bool $rec /** * Provides/instantiates the builder/db connection and model's table/primary key names and return type. * - * @param string $name Name - * - * @return array|BaseBuilder|bool|float|int|object|string|null + * @return array|BaseBuilder|bool|float|int|object|string|null */ public function __get(string $name) { @@ -894,8 +716,6 @@ public function __get(string $name) /** * Checks for the existence of properties across this model, builder, and db connection. - * - * @param string $name Name */ public function __isset(string $name): bool { @@ -910,7 +730,7 @@ public function __isset(string $name): bool * Provides direct access to method in the builder (if available) * and the database connection. * - * @return $this|array|BaseBuilder|bool|float|int|object|string|null + * @return $this|array|BaseBuilder|bool|float|int|object|string|null */ public function __call(string $name, array $params) { diff --git a/tests/system/Models/UpdateModelTest.php b/tests/system/Models/UpdateModelTest.php index 1dc7249c3efd..a9380f34c771 100644 --- a/tests/system/Models/UpdateModelTest.php +++ b/tests/system/Models/UpdateModelTest.php @@ -561,7 +561,7 @@ public function testUpdateThrowDatabaseExceptionWithoutWhereClause($id, string $ // $useSoftDeletes = false $this->createModel(JobModel::class); - $this->model->update($id, ['name' => 'Foo Bar']); + $this->model->update($id, ['name' => 'Foo Bar']); // @phpstan-ignore argument.type } public static function provideUpdateThrowDatabaseExceptionWithoutWhereClause(): iterable diff --git a/tests/system/Models/ValidationModelRuleGroupTest.php b/tests/system/Models/ValidationModelRuleGroupTest.php index eb50406ab62b..37e0ae4e3e6e 100644 --- a/tests/system/Models/ValidationModelRuleGroupTest.php +++ b/tests/system/Models/ValidationModelRuleGroupTest.php @@ -201,7 +201,7 @@ public function testCleanValidationRemovesAllWhenNoDataProvided(): void 'foo' => 'bar', ]; - $rules = $cleaner($rules, null); + $rules = $cleaner($rules, []); $this->assertEmpty($rules); } diff --git a/tests/system/Models/ValidationModelTest.php b/tests/system/Models/ValidationModelTest.php index 4a99d8fae5bb..7ec08c9e36ac 100644 --- a/tests/system/Models/ValidationModelTest.php +++ b/tests/system/Models/ValidationModelTest.php @@ -189,7 +189,7 @@ public function testCleanValidationRemovesAllWhenNoDataProvided(): void 'foo' => 'bar', ]; - $rules = $cleaner($rules, null); + $rules = $cleaner($rules, []); $this->assertEmpty($rules); } diff --git a/user_guide_src/source/changelogs/v4.7.0.rst b/user_guide_src/source/changelogs/v4.7.0.rst index 5a3d9a401b2c..bbc09fc8d60f 100644 --- a/user_guide_src/source/changelogs/v4.7.0.rst +++ b/user_guide_src/source/changelogs/v4.7.0.rst @@ -49,6 +49,8 @@ Interface Changes Method Signature Changes ======================== +- **BaseModel:** The type of the ``$row`` parameter for the ``cleanValidationRules()`` method has been changed from ``?array $row = null`` to ``array $row``. + - Added the ``SensitiveParameter`` attribute to various methods to conceal sensitive information from stack traces. Affected methods are: - ``CodeIgniter\Encryption\EncrypterInterface::encrypt()`` - ``CodeIgniter\Encryption\EncrypterInterface::decrypt()`` diff --git a/user_guide_src/source/models/model.rst b/user_guide_src/source/models/model.rst index 182aed11ac0b..c9be9878e094 100644 --- a/user_guide_src/source/models/model.rst +++ b/user_guide_src/source/models/model.rst @@ -765,9 +765,9 @@ The other way to set the validation message to fields by functions, .. literalinclude:: model/030.php -.. php:method:: setValidationMessages($fieldMessages) +.. php:method:: setValidationMessages($validationMessages) - :param array $fieldMessages: + :param array $validationMessages: This function will set the field messages. diff --git a/utils/phpstan-baseline/argument.type.neon b/utils/phpstan-baseline/argument.type.neon index 0c99d09b54e3..91faa4168630 100644 --- a/utils/phpstan-baseline/argument.type.neon +++ b/utils/phpstan-baseline/argument.type.neon @@ -1,4 +1,4 @@ -# total 85 errors +# total 84 errors parameters: ignoreErrors: @@ -28,12 +28,12 @@ parameters: path: ../../system/Database/SQLite3/Builder.php - - message: '#^Parameter \#2 \$to of method CodeIgniter\\Router\\RouteCollection\:\:add\(\) expects array\|\(Closure\(mixed \.\.\.\)\: \(CodeIgniter\\HTTP\\ResponseInterface\|string\|void\)\)\|string, Closure\(mixed\)\: \(CodeIgniter\\HTTP\\DownloadResponse\|null\) given\.$#' + message: '#^Parameter \#2 \$to of method CodeIgniter\\Router\\RouteCollection\:\:add\(\) expects array\|\(Closure\(mixed \.\.\.\)\: \(CodeIgniter\\HTTP\\ResponseInterface\|string\|void\)\)\|string, Closure\(mixed\)\: CodeIgniter\\HTTP\\ResponseInterface given\.$#' count: 1 path: ../../tests/system/CodeIgniterTest.php - - message: '#^Parameter \#2 \$to of method CodeIgniter\\Router\\RouteCollection\:\:add\(\) expects array\|\(Closure\(mixed \.\.\.\)\: \(CodeIgniter\\HTTP\\ResponseInterface\|string\|void\)\)\|string, Closure\(mixed\)\: CodeIgniter\\HTTP\\ResponseInterface given\.$#' + message: '#^Parameter \#2 \$to of method CodeIgniter\\Router\\RouteCollection\:\:add\(\) expects array\|\(Closure\(mixed \.\.\.\)\: \(CodeIgniter\\HTTP\\ResponseInterface\|string\|void\)\)\|string, Closure\(mixed\)\: \(CodeIgniter\\HTTP\\DownloadResponse\|null\) given\.$#' count: 1 path: ../../tests/system/CodeIgniterTest.php @@ -197,11 +197,6 @@ parameters: count: 1 path: ../../tests/system/Models/DataConverterModelTest.php - - - message: '#^Parameter \#1 \$id of method CodeIgniter\\Model\:\:update\(\) expects array\|int\|string\|null, false\|null given\.$#' - count: 1 - path: ../../tests/system/Models/UpdateModelTest.php - - message: '#^Parameter \#1 \$format of method CodeIgniter\\RESTful\\ResourceController\:\:setFormat\(\) expects ''json''\|''xml'', ''Nonsense'' given\.$#' count: 1 diff --git a/utils/phpstan-baseline/codeigniter.superglobalAccessAssign.neon b/utils/phpstan-baseline/codeigniter.superglobalAccessAssign.neon index 6a5f6dccbf23..71e76f0cfe41 100644 --- a/utils/phpstan-baseline/codeigniter.superglobalAccessAssign.neon +++ b/utils/phpstan-baseline/codeigniter.superglobalAccessAssign.neon @@ -338,12 +338,12 @@ parameters: path: ../../tests/system/HTTP/IncomingRequestTest.php - - message: '#^Assigning ''fr\-FR; q\=1\.0, en; q\=0\.5'' directly on offset ''HTTP_ACCEPT_LANGUAGE'' of \$_SERVER is discouraged\.$#' + message: '#^Assigning ''fr; q\=1\.0, en; q\=0\.5'' directly on offset ''HTTP_ACCEPT_LANGUAGE'' of \$_SERVER is discouraged\.$#' count: 1 path: ../../tests/system/HTTP/IncomingRequestTest.php - - message: '#^Assigning ''fr; q\=1\.0, en; q\=0\.5'' directly on offset ''HTTP_ACCEPT_LANGUAGE'' of \$_SERVER is discouraged\.$#' + message: '#^Assigning ''fr\-FR; q\=1\.0, en; q\=0\.5'' directly on offset ''HTTP_ACCEPT_LANGUAGE'' of \$_SERVER is discouraged\.$#' count: 1 path: ../../tests/system/HTTP/IncomingRequestTest.php diff --git a/utils/phpstan-baseline/loader.neon b/utils/phpstan-baseline/loader.neon index 5d96dc562b91..50220a8e8989 100644 --- a/utils/phpstan-baseline/loader.neon +++ b/utils/phpstan-baseline/loader.neon @@ -1,4 +1,4 @@ -# total 2760 errors +# total 2708 errors includes: - argument.type.neon diff --git a/utils/phpstan-baseline/method.childReturnType.neon b/utils/phpstan-baseline/method.childReturnType.neon index adf2f2999aaf..cb796e2ba89f 100644 --- a/utils/phpstan-baseline/method.childReturnType.neon +++ b/utils/phpstan-baseline/method.childReturnType.neon @@ -1,4 +1,4 @@ -# total 29 errors +# total 28 errors parameters: ignoreErrors: @@ -93,22 +93,22 @@ parameters: path: ../../system/Database/SQLite3/PreparedQuery.php - - message: '#^Return type \(CodeIgniter\\HTTP\\DownloadResponse\) of method CodeIgniter\\HTTP\\DownloadResponse\:\:sendBody\(\) should be covariant with return type \(\$this\(CodeIgniter\\HTTP\\Response\)\) of method CodeIgniter\\HTTP\\Response\:\:sendBody\(\)$#' + message: '#^Return type \(CodeIgniter\\HTTP\\DownloadResponse\) of method CodeIgniter\\HTTP\\DownloadResponse\:\:sendBody\(\) should be covariant with return type \(\$this\(CodeIgniter\\HTTP\\ResponseInterface\)\) of method CodeIgniter\\HTTP\\ResponseInterface\:\:sendBody\(\)$#' count: 1 path: ../../system/HTTP/DownloadResponse.php - - message: '#^Return type \(CodeIgniter\\HTTP\\DownloadResponse\) of method CodeIgniter\\HTTP\\DownloadResponse\:\:sendBody\(\) should be covariant with return type \(\$this\(CodeIgniter\\HTTP\\ResponseInterface\)\) of method CodeIgniter\\HTTP\\ResponseInterface\:\:sendBody\(\)$#' + message: '#^Return type \(CodeIgniter\\HTTP\\DownloadResponse\) of method CodeIgniter\\HTTP\\DownloadResponse\:\:sendBody\(\) should be covariant with return type \(\$this\(CodeIgniter\\HTTP\\Response\)\) of method CodeIgniter\\HTTP\\Response\:\:sendBody\(\)$#' count: 1 path: ../../system/HTTP/DownloadResponse.php - - message: '#^Return type \(CodeIgniter\\HTTP\\ResponseInterface\) of method CodeIgniter\\HTTP\\DownloadResponse\:\:setContentType\(\) should be covariant with return type \(\$this\(CodeIgniter\\HTTP\\Response\)\) of method CodeIgniter\\HTTP\\Response\:\:setContentType\(\)$#' + message: '#^Return type \(CodeIgniter\\HTTP\\ResponseInterface\) of method CodeIgniter\\HTTP\\DownloadResponse\:\:setContentType\(\) should be covariant with return type \(\$this\(CodeIgniter\\HTTP\\ResponseInterface\)\) of method CodeIgniter\\HTTP\\ResponseInterface\:\:setContentType\(\)$#' count: 1 path: ../../system/HTTP/DownloadResponse.php - - message: '#^Return type \(CodeIgniter\\HTTP\\ResponseInterface\) of method CodeIgniter\\HTTP\\DownloadResponse\:\:setContentType\(\) should be covariant with return type \(\$this\(CodeIgniter\\HTTP\\ResponseInterface\)\) of method CodeIgniter\\HTTP\\ResponseInterface\:\:setContentType\(\)$#' + message: '#^Return type \(CodeIgniter\\HTTP\\ResponseInterface\) of method CodeIgniter\\HTTP\\DownloadResponse\:\:setContentType\(\) should be covariant with return type \(\$this\(CodeIgniter\\HTTP\\Response\)\) of method CodeIgniter\\HTTP\\Response\:\:setContentType\(\)$#' count: 1 path: ../../system/HTTP/DownloadResponse.php @@ -141,8 +141,3 @@ parameters: message: '#^Return type \(CodeIgniter\\Images\\Handlers\\ImageMagickHandler\) of method CodeIgniter\\Images\\Handlers\\ImageMagickHandler\:\:_resize\(\) should be covariant with return type \(\$this\(CodeIgniter\\Images\\Handlers\\BaseHandler\)\) of method CodeIgniter\\Images\\Handlers\\BaseHandler\:\:_resize\(\)$#' count: 1 path: ../../system/Images/Handlers/ImageMagickHandler.php - - - - message: '#^Return type \(array\|bool\|float\|int\|object\|string\|null\) of method CodeIgniter\\Model\:\:__call\(\) should be covariant with return type \(\$this\(CodeIgniter\\BaseModel\)\|null\) of method CodeIgniter\\BaseModel\:\:__call\(\)$#' - count: 1 - path: ../../system/Model.php diff --git a/utils/phpstan-baseline/method.notFound.neon b/utils/phpstan-baseline/method.notFound.neon index 8bc0b8ae54c0..1018f0fc8119 100644 --- a/utils/phpstan-baseline/method.notFound.neon +++ b/utils/phpstan-baseline/method.notFound.neon @@ -58,12 +58,12 @@ parameters: path: ../../tests/system/HTTP/IncomingRequestTest.php - - message: '#^Call to an undefined method CodeIgniter\\HTTP\\Request\:\:getFile\(\)\.$#' + message: '#^Call to an undefined method CodeIgniter\\HTTP\\Request\:\:getFileMultiple\(\)\.$#' count: 1 path: ../../tests/system/HTTP/IncomingRequestTest.php - - message: '#^Call to an undefined method CodeIgniter\\HTTP\\Request\:\:getFileMultiple\(\)\.$#' + message: '#^Call to an undefined method CodeIgniter\\HTTP\\Request\:\:getFile\(\)\.$#' count: 1 path: ../../tests/system/HTTP/IncomingRequestTest.php @@ -73,13 +73,13 @@ parameters: path: ../../tests/system/HTTP/IncomingRequestTest.php - - message: '#^Call to an undefined method CodeIgniter\\HTTP\\Request\:\:getGet\(\)\.$#' - count: 2 + message: '#^Call to an undefined method CodeIgniter\\HTTP\\Request\:\:getGetPost\(\)\.$#' + count: 5 path: ../../tests/system/HTTP/IncomingRequestTest.php - - message: '#^Call to an undefined method CodeIgniter\\HTTP\\Request\:\:getGetPost\(\)\.$#' - count: 5 + message: '#^Call to an undefined method CodeIgniter\\HTTP\\Request\:\:getGet\(\)\.$#' + count: 2 path: ../../tests/system/HTTP/IncomingRequestTest.php - @@ -92,24 +92,19 @@ parameters: count: 9 path: ../../tests/system/HTTP/IncomingRequestTest.php - - - message: '#^Call to an undefined method CodeIgniter\\HTTP\\Request\:\:getPost\(\)\.$#' - count: 2 - path: ../../tests/system/HTTP/IncomingRequestTest.php - - message: '#^Call to an undefined method CodeIgniter\\HTTP\\Request\:\:getPostGet\(\)\.$#' count: 5 path: ../../tests/system/HTTP/IncomingRequestTest.php - - message: '#^Call to an undefined method CodeIgniter\\HTTP\\Request\:\:getVar\(\)\.$#' + message: '#^Call to an undefined method CodeIgniter\\HTTP\\Request\:\:getPost\(\)\.$#' count: 2 path: ../../tests/system/HTTP/IncomingRequestTest.php - - message: '#^Call to an undefined method CodeIgniter\\HTTP\\Request\:\:is\(\)\.$#' - count: 5 + message: '#^Call to an undefined method CodeIgniter\\HTTP\\Request\:\:getVar\(\)\.$#' + count: 2 path: ../../tests/system/HTTP/IncomingRequestTest.php - @@ -127,6 +122,11 @@ parameters: count: 3 path: ../../tests/system/HTTP/IncomingRequestTest.php + - + message: '#^Call to an undefined method CodeIgniter\\HTTP\\Request\:\:is\(\)\.$#' + count: 5 + path: ../../tests/system/HTTP/IncomingRequestTest.php + - message: '#^Call to an undefined method CodeIgniter\\HTTP\\Request\:\:negotiate\(\)\.$#' count: 5 diff --git a/utils/phpstan-baseline/missingType.callable.neon b/utils/phpstan-baseline/missingType.callable.neon index 9429a25441eb..5d0d90d58d56 100644 --- a/utils/phpstan-baseline/missingType.callable.neon +++ b/utils/phpstan-baseline/missingType.callable.neon @@ -3,22 +3,22 @@ parameters: ignoreErrors: - - message: '#^Class CodeIgniter\\Model has PHPDoc tag @method for method when\(\) parameter \#2 \$callback with no signature specified for callable\.$#' + message: '#^Class CodeIgniter\\Model has PHPDoc tag @method for method whenNot\(\) parameter \#2 \$callback with no signature specified for callable\.$#' count: 1 path: ../../system/Model.php - - message: '#^Class CodeIgniter\\Model has PHPDoc tag @method for method when\(\) parameter \#3 \$defaultCallback with no signature specified for callable\.$#' + message: '#^Class CodeIgniter\\Model has PHPDoc tag @method for method whenNot\(\) parameter \#3 \$defaultCallback with no signature specified for callable\.$#' count: 1 path: ../../system/Model.php - - message: '#^Class CodeIgniter\\Model has PHPDoc tag @method for method whenNot\(\) parameter \#2 \$callback with no signature specified for callable\.$#' + message: '#^Class CodeIgniter\\Model has PHPDoc tag @method for method when\(\) parameter \#2 \$callback with no signature specified for callable\.$#' count: 1 path: ../../system/Model.php - - message: '#^Class CodeIgniter\\Model has PHPDoc tag @method for method whenNot\(\) parameter \#3 \$defaultCallback with no signature specified for callable\.$#' + message: '#^Class CodeIgniter\\Model has PHPDoc tag @method for method when\(\) parameter \#3 \$defaultCallback with no signature specified for callable\.$#' count: 1 path: ../../system/Model.php diff --git a/utils/phpstan-baseline/missingType.iterableValue.neon b/utils/phpstan-baseline/missingType.iterableValue.neon index 5f36d7f3b445..9d944d2ed357 100644 --- a/utils/phpstan-baseline/missingType.iterableValue.neon +++ b/utils/phpstan-baseline/missingType.iterableValue.neon @@ -1,182 +1,7 @@ -# total 1370 errors +# total 1320 errors parameters: ignoreErrors: - - - message: '#^Method CodeIgniter\\BaseModel\:\:__call\(\) has parameter \$params with no value type specified in iterable type array\.$#' - count: 1 - path: ../../system/BaseModel.php - - - - message: '#^Method CodeIgniter\\BaseModel\:\:__get\(\) return type has no value type specified in iterable type array\.$#' - count: 1 - path: ../../system/BaseModel.php - - - - message: '#^Method CodeIgniter\\BaseModel\:\:cleanValidationRules\(\) has parameter \$rules with no value type specified in iterable type array\.$#' - count: 1 - path: ../../system/BaseModel.php - - - - message: '#^Method CodeIgniter\\BaseModel\:\:cleanValidationRules\(\) return type has no value type specified in iterable type array\.$#' - count: 1 - path: ../../system/BaseModel.php - - - - message: '#^Method CodeIgniter\\BaseModel\:\:convertToReturnType\(\) return type has no value type specified in iterable type array\.$#' - count: 1 - path: ../../system/BaseModel.php - - - - message: '#^Method CodeIgniter\\BaseModel\:\:doDelete\(\) has parameter \$id with no value type specified in iterable type array\.$#' - count: 1 - path: ../../system/BaseModel.php - - - - message: '#^Method CodeIgniter\\BaseModel\:\:doFind\(\) has parameter \$id with no value type specified in iterable type array\.$#' - count: 1 - path: ../../system/BaseModel.php - - - - message: '#^Method CodeIgniter\\BaseModel\:\:doFind\(\) return type has no value type specified in iterable type array\.$#' - count: 1 - path: ../../system/BaseModel.php - - - - message: '#^Method CodeIgniter\\BaseModel\:\:doFindAll\(\) return type has no value type specified in iterable type array\.$#' - count: 1 - path: ../../system/BaseModel.php - - - - message: '#^Method CodeIgniter\\BaseModel\:\:doFindColumn\(\) return type has no value type specified in iterable type array\.$#' - count: 1 - path: ../../system/BaseModel.php - - - - message: '#^Method CodeIgniter\\BaseModel\:\:doFirst\(\) return type has no value type specified in iterable type array\.$#' - count: 1 - path: ../../system/BaseModel.php - - - - message: '#^Method CodeIgniter\\BaseModel\:\:doInsertBatch\(\) has parameter \$set with no value type specified in iterable type array\.$#' - count: 1 - path: ../../system/BaseModel.php - - - - message: '#^Method CodeIgniter\\BaseModel\:\:doProtectFields\(\) return type has no value type specified in iterable type array\.$#' - count: 1 - path: ../../system/BaseModel.php - - - - message: '#^Method CodeIgniter\\BaseModel\:\:doProtectFieldsForInsert\(\) return type has no value type specified in iterable type array\.$#' - count: 1 - path: ../../system/BaseModel.php - - - - message: '#^Method CodeIgniter\\BaseModel\:\:doUpdate\(\) has parameter \$id with no value type specified in iterable type array\.$#' - count: 1 - path: ../../system/BaseModel.php - - - - message: '#^Method CodeIgniter\\BaseModel\:\:doUpdateBatch\(\) has parameter \$set with no value type specified in iterable type array\.$#' - count: 1 - path: ../../system/BaseModel.php - - - - message: '#^Method CodeIgniter\\BaseModel\:\:find\(\) has parameter \$id with no value type specified in iterable type array\.$#' - count: 1 - path: ../../system/BaseModel.php - - - - message: '#^Method CodeIgniter\\BaseModel\:\:findAll\(\) return type has no value type specified in iterable type array\.$#' - count: 1 - path: ../../system/BaseModel.php - - - - message: '#^Method CodeIgniter\\BaseModel\:\:findColumn\(\) return type has no value type specified in iterable type array\.$#' - count: 1 - path: ../../system/BaseModel.php - - - - message: '#^Method CodeIgniter\\BaseModel\:\:first\(\) return type has no value type specified in iterable type array\.$#' - count: 1 - path: ../../system/BaseModel.php - - - - message: '#^Method CodeIgniter\\BaseModel\:\:getIdValue\(\) return type has no value type specified in iterable type array\.$#' - count: 1 - path: ../../system/BaseModel.php - - - - message: '#^Method CodeIgniter\\BaseModel\:\:getValidationMessages\(\) return type has no value type specified in iterable type array\.$#' - count: 1 - path: ../../system/BaseModel.php - - - - message: '#^Method CodeIgniter\\BaseModel\:\:getValidationRules\(\) has parameter \$options with no value type specified in iterable type array\.$#' - count: 1 - path: ../../system/BaseModel.php - - - - message: '#^Method CodeIgniter\\BaseModel\:\:getValidationRules\(\) return type has no value type specified in iterable type array\.$#' - count: 1 - path: ../../system/BaseModel.php - - - - message: '#^Method CodeIgniter\\BaseModel\:\:paginate\(\) return type has no value type specified in iterable type array\.$#' - count: 1 - path: ../../system/BaseModel.php - - - - message: '#^Method CodeIgniter\\BaseModel\:\:setAllowedFields\(\) has parameter \$allowedFields with no value type specified in iterable type array\.$#' - count: 1 - path: ../../system/BaseModel.php - - - - message: '#^Method CodeIgniter\\BaseModel\:\:setCreatedField\(\) return type has no value type specified in iterable type array\.$#' - count: 1 - path: ../../system/BaseModel.php - - - - message: '#^Method CodeIgniter\\BaseModel\:\:setUpdatedField\(\) return type has no value type specified in iterable type array\.$#' - count: 1 - path: ../../system/BaseModel.php - - - - message: '#^Method CodeIgniter\\BaseModel\:\:setValidationMessage\(\) has parameter \$fieldMessages with no value type specified in iterable type array\.$#' - count: 1 - path: ../../system/BaseModel.php - - - - message: '#^Method CodeIgniter\\BaseModel\:\:setValidationMessages\(\) has parameter \$validationMessages with no value type specified in iterable type array\.$#' - count: 1 - path: ../../system/BaseModel.php - - - - message: '#^Method CodeIgniter\\BaseModel\:\:setValidationRule\(\) has parameter \$fieldRules with no value type specified in iterable type array\.$#' - count: 1 - path: ../../system/BaseModel.php - - - - message: '#^Method CodeIgniter\\BaseModel\:\:transformDataToArray\(\) return type has no value type specified in iterable type array\.$#' - count: 1 - path: ../../system/BaseModel.php - - - - message: '#^Method CodeIgniter\\BaseModel\:\:trigger\(\) has parameter \$eventData with no value type specified in iterable type array\.$#' - count: 1 - path: ../../system/BaseModel.php - - - - message: '#^Method CodeIgniter\\BaseModel\:\:trigger\(\) return type has no value type specified in iterable type array\.$#' - count: 1 - path: ../../system/BaseModel.php - - - - message: '#^Method CodeIgniter\\BaseModel\:\:update\(\) has parameter \$id with no value type specified in iterable type array\.$#' - count: 1 - path: ../../system/BaseModel.php - - message: '#^Method CodeIgniter\\CLI\\CLI\:\:isZeroOptions\(\) has parameter \$options with no value type specified in iterable type array\.$#' count: 1 @@ -187,11 +12,6 @@ parameters: count: 1 path: ../../system/CLI/CLI.php - - - message: '#^Method CodeIgniter\\CLI\\CLI\:\:prompt\(\) has parameter \$validation with no value type specified in iterable type array\.$#' - count: 1 - path: ../../system/CLI/CLI.php - - message: '#^Method CodeIgniter\\CLI\\CLI\:\:promptByKey\(\) has parameter \$options with no value type specified in iterable type array\.$#' count: 1 @@ -217,6 +37,11 @@ parameters: count: 1 path: ../../system/CLI/CLI.php + - + message: '#^Method CodeIgniter\\CLI\\CLI\:\:prompt\(\) has parameter \$validation with no value type specified in iterable type array\.$#' + count: 1 + path: ../../system/CLI/CLI.php + - message: '#^Method CodeIgniter\\CLI\\CLI\:\:table\(\) has parameter \$tbody with no value type specified in iterable type array\.$#' count: 1 @@ -518,27 +343,27 @@ parameters: path: ../../system/Controller.php - - message: '#^Method CodeIgniter\\Controller\:\:validate\(\) has parameter \$messages with no value type specified in iterable type array\.$#' + message: '#^Method CodeIgniter\\Controller\:\:validateData\(\) has parameter \$data with no value type specified in iterable type array\.$#' count: 1 path: ../../system/Controller.php - - message: '#^Method CodeIgniter\\Controller\:\:validate\(\) has parameter \$rules with no value type specified in iterable type array\.$#' + message: '#^Method CodeIgniter\\Controller\:\:validateData\(\) has parameter \$messages with no value type specified in iterable type array\.$#' count: 1 path: ../../system/Controller.php - - message: '#^Method CodeIgniter\\Controller\:\:validateData\(\) has parameter \$data with no value type specified in iterable type array\.$#' + message: '#^Method CodeIgniter\\Controller\:\:validateData\(\) has parameter \$rules with no value type specified in iterable type array\.$#' count: 1 path: ../../system/Controller.php - - message: '#^Method CodeIgniter\\Controller\:\:validateData\(\) has parameter \$messages with no value type specified in iterable type array\.$#' + message: '#^Method CodeIgniter\\Controller\:\:validate\(\) has parameter \$messages with no value type specified in iterable type array\.$#' count: 1 path: ../../system/Controller.php - - message: '#^Method CodeIgniter\\Controller\:\:validateData\(\) has parameter \$rules with no value type specified in iterable type array\.$#' + message: '#^Method CodeIgniter\\Controller\:\:validate\(\) has parameter \$rules with no value type specified in iterable type array\.$#' count: 1 path: ../../system/Controller.php @@ -582,11 +407,6 @@ parameters: count: 1 path: ../../system/Database/BaseBuilder.php - - - message: '#^Method CodeIgniter\\Database\\BaseBuilder\:\:_whereIn\(\) has parameter \$values with no value type specified in iterable type array\.$#' - count: 1 - path: ../../system/Database/BaseBuilder.php - - message: '#^Method CodeIgniter\\Database\\BaseBuilder\:\:batchObjectToArray\(\) has parameter \$object with no value type specified in iterable type array\.$#' count: 1 @@ -598,17 +418,17 @@ parameters: path: ../../system/Database/BaseBuilder.php - - message: '#^Method CodeIgniter\\Database\\BaseBuilder\:\:delete\(\) has parameter \$where with no value type specified in iterable type array\.$#' + message: '#^Method CodeIgniter\\Database\\BaseBuilder\:\:deleteBatch\(\) has parameter \$constraints with no value type specified in iterable type array\.$#' count: 1 path: ../../system/Database/BaseBuilder.php - - message: '#^Method CodeIgniter\\Database\\BaseBuilder\:\:deleteBatch\(\) has parameter \$constraints with no value type specified in iterable type array\.$#' + message: '#^Method CodeIgniter\\Database\\BaseBuilder\:\:deleteBatch\(\) has parameter \$set with no value type specified in iterable type array\.$#' count: 1 path: ../../system/Database/BaseBuilder.php - - message: '#^Method CodeIgniter\\Database\\BaseBuilder\:\:deleteBatch\(\) has parameter \$set with no value type specified in iterable type array\.$#' + message: '#^Method CodeIgniter\\Database\\BaseBuilder\:\:delete\(\) has parameter \$where with no value type specified in iterable type array\.$#' count: 1 path: ../../system/Database/BaseBuilder.php @@ -662,11 +482,6 @@ parameters: count: 1 path: ../../system/Database/BaseBuilder.php - - - message: '#^Method CodeIgniter\\Database\\BaseBuilder\:\:having\(\) has parameter \$key with no value type specified in iterable type array\.$#' - count: 1 - path: ../../system/Database/BaseBuilder.php - - message: '#^Method CodeIgniter\\Database\\BaseBuilder\:\:havingIn\(\) has parameter \$values with no value type specified in iterable type array\.$#' count: 1 @@ -683,7 +498,7 @@ parameters: path: ../../system/Database/BaseBuilder.php - - message: '#^Method CodeIgniter\\Database\\BaseBuilder\:\:insert\(\) has parameter \$set with no value type specified in iterable type array\.$#' + message: '#^Method CodeIgniter\\Database\\BaseBuilder\:\:having\(\) has parameter \$key with no value type specified in iterable type array\.$#' count: 1 path: ../../system/Database/BaseBuilder.php @@ -692,6 +507,11 @@ parameters: count: 1 path: ../../system/Database/BaseBuilder.php + - + message: '#^Method CodeIgniter\\Database\\BaseBuilder\:\:insert\(\) has parameter \$set with no value type specified in iterable type array\.$#' + count: 1 + path: ../../system/Database/BaseBuilder.php + - message: '#^Method CodeIgniter\\Database\\BaseBuilder\:\:like\(\) has parameter \$field with no value type specified in iterable type array\.$#' count: 1 @@ -722,11 +542,6 @@ parameters: count: 1 path: ../../system/Database/BaseBuilder.php - - - message: '#^Method CodeIgniter\\Database\\BaseBuilder\:\:orHaving\(\) has parameter \$key with no value type specified in iterable type array\.$#' - count: 1 - path: ../../system/Database/BaseBuilder.php - - message: '#^Method CodeIgniter\\Database\\BaseBuilder\:\:orHavingIn\(\) has parameter \$values with no value type specified in iterable type array\.$#' count: 1 @@ -743,22 +558,22 @@ parameters: path: ../../system/Database/BaseBuilder.php - - message: '#^Method CodeIgniter\\Database\\BaseBuilder\:\:orLike\(\) has parameter \$field with no value type specified in iterable type array\.$#' + message: '#^Method CodeIgniter\\Database\\BaseBuilder\:\:orHaving\(\) has parameter \$key with no value type specified in iterable type array\.$#' count: 1 path: ../../system/Database/BaseBuilder.php - - message: '#^Method CodeIgniter\\Database\\BaseBuilder\:\:orNotHavingLike\(\) has parameter \$field with no value type specified in iterable type array\.$#' + message: '#^Method CodeIgniter\\Database\\BaseBuilder\:\:orLike\(\) has parameter \$field with no value type specified in iterable type array\.$#' count: 1 path: ../../system/Database/BaseBuilder.php - - message: '#^Method CodeIgniter\\Database\\BaseBuilder\:\:orNotLike\(\) has parameter \$field with no value type specified in iterable type array\.$#' + message: '#^Method CodeIgniter\\Database\\BaseBuilder\:\:orNotHavingLike\(\) has parameter \$field with no value type specified in iterable type array\.$#' count: 1 path: ../../system/Database/BaseBuilder.php - - message: '#^Method CodeIgniter\\Database\\BaseBuilder\:\:orWhere\(\) has parameter \$key with no value type specified in iterable type array\.$#' + message: '#^Method CodeIgniter\\Database\\BaseBuilder\:\:orNotLike\(\) has parameter \$field with no value type specified in iterable type array\.$#' count: 1 path: ../../system/Database/BaseBuilder.php @@ -773,17 +588,17 @@ parameters: path: ../../system/Database/BaseBuilder.php - - message: '#^Method CodeIgniter\\Database\\BaseBuilder\:\:replace\(\) has parameter \$set with no value type specified in iterable type array\.$#' + message: '#^Method CodeIgniter\\Database\\BaseBuilder\:\:orWhere\(\) has parameter \$key with no value type specified in iterable type array\.$#' count: 1 path: ../../system/Database/BaseBuilder.php - - message: '#^Method CodeIgniter\\Database\\BaseBuilder\:\:resetRun\(\) has parameter \$qbResetItems with no value type specified in iterable type array\.$#' + message: '#^Method CodeIgniter\\Database\\BaseBuilder\:\:replace\(\) has parameter \$set with no value type specified in iterable type array\.$#' count: 1 path: ../../system/Database/BaseBuilder.php - - message: '#^Method CodeIgniter\\Database\\BaseBuilder\:\:set\(\) has parameter \$key with no value type specified in iterable type array\.$#' + message: '#^Method CodeIgniter\\Database\\BaseBuilder\:\:resetRun\(\) has parameter \$qbResetItems with no value type specified in iterable type array\.$#' count: 1 path: ../../system/Database/BaseBuilder.php @@ -803,37 +618,37 @@ parameters: path: ../../system/Database/BaseBuilder.php - - message: '#^Method CodeIgniter\\Database\\BaseBuilder\:\:trackAliases\(\) has parameter \$table with no value type specified in iterable type array\.$#' + message: '#^Method CodeIgniter\\Database\\BaseBuilder\:\:set\(\) has parameter \$key with no value type specified in iterable type array\.$#' count: 1 path: ../../system/Database/BaseBuilder.php - - message: '#^Method CodeIgniter\\Database\\BaseBuilder\:\:update\(\) has parameter \$set with no value type specified in iterable type array\.$#' + message: '#^Method CodeIgniter\\Database\\BaseBuilder\:\:trackAliases\(\) has parameter \$table with no value type specified in iterable type array\.$#' count: 1 path: ../../system/Database/BaseBuilder.php - - message: '#^Method CodeIgniter\\Database\\BaseBuilder\:\:update\(\) has parameter \$where with no value type specified in iterable type array\.$#' + message: '#^Method CodeIgniter\\Database\\BaseBuilder\:\:updateBatch\(\) has parameter \$constraints with no value type specified in iterable type array\.$#' count: 1 path: ../../system/Database/BaseBuilder.php - - message: '#^Method CodeIgniter\\Database\\BaseBuilder\:\:updateBatch\(\) has parameter \$constraints with no value type specified in iterable type array\.$#' + message: '#^Method CodeIgniter\\Database\\BaseBuilder\:\:updateBatch\(\) has parameter \$set with no value type specified in iterable type array\.$#' count: 1 path: ../../system/Database/BaseBuilder.php - - message: '#^Method CodeIgniter\\Database\\BaseBuilder\:\:updateBatch\(\) has parameter \$set with no value type specified in iterable type array\.$#' + message: '#^Method CodeIgniter\\Database\\BaseBuilder\:\:updateFields\(\) has parameter \$ignore with no value type specified in iterable type array\.$#' count: 1 path: ../../system/Database/BaseBuilder.php - - message: '#^Method CodeIgniter\\Database\\BaseBuilder\:\:updateFields\(\) has parameter \$ignore with no value type specified in iterable type array\.$#' + message: '#^Method CodeIgniter\\Database\\BaseBuilder\:\:update\(\) has parameter \$set with no value type specified in iterable type array\.$#' count: 1 path: ../../system/Database/BaseBuilder.php - - message: '#^Method CodeIgniter\\Database\\BaseBuilder\:\:upsert\(\) has parameter \$set with no value type specified in iterable type array\.$#' + message: '#^Method CodeIgniter\\Database\\BaseBuilder\:\:update\(\) has parameter \$where with no value type specified in iterable type array\.$#' count: 1 path: ../../system/Database/BaseBuilder.php @@ -843,7 +658,7 @@ parameters: path: ../../system/Database/BaseBuilder.php - - message: '#^Method CodeIgniter\\Database\\BaseBuilder\:\:where\(\) has parameter \$key with no value type specified in iterable type array\.$#' + message: '#^Method CodeIgniter\\Database\\BaseBuilder\:\:upsert\(\) has parameter \$set with no value type specified in iterable type array\.$#' count: 1 path: ../../system/Database/BaseBuilder.php @@ -862,6 +677,11 @@ parameters: count: 1 path: ../../system/Database/BaseBuilder.php + - + message: '#^Method CodeIgniter\\Database\\BaseBuilder\:\:where\(\) has parameter \$key with no value type specified in iterable type array\.$#' + count: 1 + path: ../../system/Database/BaseBuilder.php + - message: '#^Property CodeIgniter\\Database\\BaseBuilder\:\:\$QBFrom type has no value type specified in iterable type array\.$#' count: 1 @@ -958,22 +778,22 @@ parameters: path: ../../system/Database/BaseConnection.php - - message: '#^Method CodeIgniter\\Database\\BaseConnection\:\:escape\(\) has parameter \$str with no value type specified in iterable type array\.$#' + message: '#^Method CodeIgniter\\Database\\BaseConnection\:\:escapeIdentifiers\(\) has parameter \$item with no value type specified in iterable type array\.$#' count: 1 path: ../../system/Database/BaseConnection.php - - message: '#^Method CodeIgniter\\Database\\BaseConnection\:\:escape\(\) return type has no value type specified in iterable type array\.$#' + message: '#^Method CodeIgniter\\Database\\BaseConnection\:\:escapeIdentifiers\(\) return type has no value type specified in iterable type array\.$#' count: 1 path: ../../system/Database/BaseConnection.php - - message: '#^Method CodeIgniter\\Database\\BaseConnection\:\:escapeIdentifiers\(\) has parameter \$item with no value type specified in iterable type array\.$#' + message: '#^Method CodeIgniter\\Database\\BaseConnection\:\:escape\(\) has parameter \$str with no value type specified in iterable type array\.$#' count: 1 path: ../../system/Database/BaseConnection.php - - message: '#^Method CodeIgniter\\Database\\BaseConnection\:\:escapeIdentifiers\(\) return type has no value type specified in iterable type array\.$#' + message: '#^Method CodeIgniter\\Database\\BaseConnection\:\:escape\(\) return type has no value type specified in iterable type array\.$#' count: 1 path: ../../system/Database/BaseConnection.php @@ -1098,22 +918,22 @@ parameters: path: ../../system/Database/BaseResult.php - - message: '#^Method CodeIgniter\\Database\\BaseResult\:\:getResult\(\) return type has no value type specified in iterable type array\.$#' + message: '#^Method CodeIgniter\\Database\\BaseResult\:\:getResultArray\(\) return type has no value type specified in iterable type array\.$#' count: 1 path: ../../system/Database/BaseResult.php - - message: '#^Method CodeIgniter\\Database\\BaseResult\:\:getResultArray\(\) return type has no value type specified in iterable type array\.$#' + message: '#^Method CodeIgniter\\Database\\BaseResult\:\:getResult\(\) return type has no value type specified in iterable type array\.$#' count: 1 path: ../../system/Database/BaseResult.php - - message: '#^Method CodeIgniter\\Database\\BaseResult\:\:getRow\(\) return type has no value type specified in iterable type array\.$#' + message: '#^Method CodeIgniter\\Database\\BaseResult\:\:getRowArray\(\) return type has no value type specified in iterable type array\.$#' count: 1 path: ../../system/Database/BaseResult.php - - message: '#^Method CodeIgniter\\Database\\BaseResult\:\:getRowArray\(\) return type has no value type specified in iterable type array\.$#' + message: '#^Method CodeIgniter\\Database\\BaseResult\:\:getRow\(\) return type has no value type specified in iterable type array\.$#' count: 1 path: ../../system/Database/BaseResult.php @@ -1293,12 +1113,12 @@ parameters: path: ../../system/Database/Forge.php - - message: '#^Method CodeIgniter\\Database\\Forge\:\:_createTable\(\) has parameter \$attributes with no value type specified in iterable type array\.$#' + message: '#^Method CodeIgniter\\Database\\Forge\:\:_createTableAttributes\(\) has parameter \$attributes with no value type specified in iterable type array\.$#' count: 1 path: ../../system/Database/Forge.php - - message: '#^Method CodeIgniter\\Database\\Forge\:\:_createTableAttributes\(\) has parameter \$attributes with no value type specified in iterable type array\.$#' + message: '#^Method CodeIgniter\\Database\\Forge\:\:_createTable\(\) has parameter \$attributes with no value type specified in iterable type array\.$#' count: 1 path: ../../system/Database/Forge.php @@ -1713,27 +1533,27 @@ parameters: path: ../../system/Database/ResultInterface.php - - message: '#^Method CodeIgniter\\Database\\ResultInterface\:\:getResult\(\) return type has no value type specified in iterable type array\.$#' + message: '#^Method CodeIgniter\\Database\\ResultInterface\:\:getResultArray\(\) return type has no value type specified in iterable type array\.$#' count: 1 path: ../../system/Database/ResultInterface.php - - message: '#^Method CodeIgniter\\Database\\ResultInterface\:\:getResultArray\(\) return type has no value type specified in iterable type array\.$#' + message: '#^Method CodeIgniter\\Database\\ResultInterface\:\:getResultObject\(\) return type has no value type specified in iterable type array\.$#' count: 1 path: ../../system/Database/ResultInterface.php - - message: '#^Method CodeIgniter\\Database\\ResultInterface\:\:getResultObject\(\) return type has no value type specified in iterable type array\.$#' + message: '#^Method CodeIgniter\\Database\\ResultInterface\:\:getResult\(\) return type has no value type specified in iterable type array\.$#' count: 1 path: ../../system/Database/ResultInterface.php - - message: '#^Method CodeIgniter\\Database\\ResultInterface\:\:getRow\(\) return type has no value type specified in iterable type array\.$#' + message: '#^Method CodeIgniter\\Database\\ResultInterface\:\:getRowArray\(\) return type has no value type specified in iterable type array\.$#' count: 1 path: ../../system/Database/ResultInterface.php - - message: '#^Method CodeIgniter\\Database\\ResultInterface\:\:getRowArray\(\) return type has no value type specified in iterable type array\.$#' + message: '#^Method CodeIgniter\\Database\\ResultInterface\:\:getRow\(\) return type has no value type specified in iterable type array\.$#' count: 1 path: ../../system/Database/ResultInterface.php @@ -2068,22 +1888,22 @@ parameters: path: ../../system/Debug/Toolbar.php - - message: '#^Method CodeIgniter\\Debug\\Toolbar\:\:renderTimeline\(\) has parameter \$collectors with no value type specified in iterable type array\.$#' + message: '#^Method CodeIgniter\\Debug\\Toolbar\:\:renderTimelineRecursive\(\) has parameter \$rows with no value type specified in iterable type array\.$#' count: 1 path: ../../system/Debug/Toolbar.php - - message: '#^Method CodeIgniter\\Debug\\Toolbar\:\:renderTimeline\(\) has parameter \$styles with no value type specified in iterable type array\.$#' + message: '#^Method CodeIgniter\\Debug\\Toolbar\:\:renderTimelineRecursive\(\) has parameter \$styles with no value type specified in iterable type array\.$#' count: 1 path: ../../system/Debug/Toolbar.php - - message: '#^Method CodeIgniter\\Debug\\Toolbar\:\:renderTimelineRecursive\(\) has parameter \$rows with no value type specified in iterable type array\.$#' + message: '#^Method CodeIgniter\\Debug\\Toolbar\:\:renderTimeline\(\) has parameter \$collectors with no value type specified in iterable type array\.$#' count: 1 path: ../../system/Debug/Toolbar.php - - message: '#^Method CodeIgniter\\Debug\\Toolbar\:\:renderTimelineRecursive\(\) has parameter \$styles with no value type specified in iterable type array\.$#' + message: '#^Method CodeIgniter\\Debug\\Toolbar\:\:renderTimeline\(\) has parameter \$styles with no value type specified in iterable type array\.$#' count: 1 path: ../../system/Debug/Toolbar.php @@ -2613,32 +2433,32 @@ parameters: path: ../../system/HTTP/CLIRequest.php - - message: '#^Method CodeIgniter\\HTTP\\CLIRequest\:\:getGet\(\) has parameter \$flags with no value type specified in iterable type array\.$#' + message: '#^Method CodeIgniter\\HTTP\\CLIRequest\:\:getGetPost\(\) has parameter \$flags with no value type specified in iterable type array\.$#' count: 1 path: ../../system/HTTP/CLIRequest.php - - message: '#^Method CodeIgniter\\HTTP\\CLIRequest\:\:getGet\(\) has parameter \$index with no value type specified in iterable type array\.$#' + message: '#^Method CodeIgniter\\HTTP\\CLIRequest\:\:getGetPost\(\) has parameter \$index with no value type specified in iterable type array\.$#' count: 1 path: ../../system/HTTP/CLIRequest.php - - message: '#^Method CodeIgniter\\HTTP\\CLIRequest\:\:getGet\(\) return type has no value type specified in iterable type array\.$#' + message: '#^Method CodeIgniter\\HTTP\\CLIRequest\:\:getGetPost\(\) return type has no value type specified in iterable type array\.$#' count: 1 path: ../../system/HTTP/CLIRequest.php - - message: '#^Method CodeIgniter\\HTTP\\CLIRequest\:\:getGetPost\(\) has parameter \$flags with no value type specified in iterable type array\.$#' + message: '#^Method CodeIgniter\\HTTP\\CLIRequest\:\:getGet\(\) has parameter \$flags with no value type specified in iterable type array\.$#' count: 1 path: ../../system/HTTP/CLIRequest.php - - message: '#^Method CodeIgniter\\HTTP\\CLIRequest\:\:getGetPost\(\) has parameter \$index with no value type specified in iterable type array\.$#' + message: '#^Method CodeIgniter\\HTTP\\CLIRequest\:\:getGet\(\) has parameter \$index with no value type specified in iterable type array\.$#' count: 1 path: ../../system/HTTP/CLIRequest.php - - message: '#^Method CodeIgniter\\HTTP\\CLIRequest\:\:getGetPost\(\) return type has no value type specified in iterable type array\.$#' + message: '#^Method CodeIgniter\\HTTP\\CLIRequest\:\:getGet\(\) return type has no value type specified in iterable type array\.$#' count: 1 path: ../../system/HTTP/CLIRequest.php @@ -2648,32 +2468,32 @@ parameters: path: ../../system/HTTP/CLIRequest.php - - message: '#^Method CodeIgniter\\HTTP\\CLIRequest\:\:getPost\(\) has parameter \$flags with no value type specified in iterable type array\.$#' + message: '#^Method CodeIgniter\\HTTP\\CLIRequest\:\:getPostGet\(\) has parameter \$flags with no value type specified in iterable type array\.$#' count: 1 path: ../../system/HTTP/CLIRequest.php - - message: '#^Method CodeIgniter\\HTTP\\CLIRequest\:\:getPost\(\) has parameter \$index with no value type specified in iterable type array\.$#' + message: '#^Method CodeIgniter\\HTTP\\CLIRequest\:\:getPostGet\(\) has parameter \$index with no value type specified in iterable type array\.$#' count: 1 path: ../../system/HTTP/CLIRequest.php - - message: '#^Method CodeIgniter\\HTTP\\CLIRequest\:\:getPost\(\) return type has no value type specified in iterable type array\.$#' + message: '#^Method CodeIgniter\\HTTP\\CLIRequest\:\:getPostGet\(\) return type has no value type specified in iterable type array\.$#' count: 1 path: ../../system/HTTP/CLIRequest.php - - message: '#^Method CodeIgniter\\HTTP\\CLIRequest\:\:getPostGet\(\) has parameter \$flags with no value type specified in iterable type array\.$#' + message: '#^Method CodeIgniter\\HTTP\\CLIRequest\:\:getPost\(\) has parameter \$flags with no value type specified in iterable type array\.$#' count: 1 path: ../../system/HTTP/CLIRequest.php - - message: '#^Method CodeIgniter\\HTTP\\CLIRequest\:\:getPostGet\(\) has parameter \$index with no value type specified in iterable type array\.$#' + message: '#^Method CodeIgniter\\HTTP\\CLIRequest\:\:getPost\(\) has parameter \$index with no value type specified in iterable type array\.$#' count: 1 path: ../../system/HTTP/CLIRequest.php - - message: '#^Method CodeIgniter\\HTTP\\CLIRequest\:\:getPostGet\(\) return type has no value type specified in iterable type array\.$#' + message: '#^Method CodeIgniter\\HTTP\\CLIRequest\:\:getPost\(\) return type has no value type specified in iterable type array\.$#' count: 1 path: ../../system/HTTP/CLIRequest.php @@ -3073,32 +2893,32 @@ parameters: path: ../../system/HTTP/IncomingRequest.php - - message: '#^Method CodeIgniter\\HTTP\\IncomingRequest\:\:getGet\(\) has parameter \$flags with no value type specified in iterable type array\.$#' + message: '#^Method CodeIgniter\\HTTP\\IncomingRequest\:\:getGetPost\(\) has parameter \$flags with no value type specified in iterable type array\.$#' count: 1 path: ../../system/HTTP/IncomingRequest.php - - message: '#^Method CodeIgniter\\HTTP\\IncomingRequest\:\:getGet\(\) has parameter \$index with no value type specified in iterable type array\.$#' + message: '#^Method CodeIgniter\\HTTP\\IncomingRequest\:\:getGetPost\(\) has parameter \$index with no value type specified in iterable type array\.$#' count: 1 path: ../../system/HTTP/IncomingRequest.php - - message: '#^Method CodeIgniter\\HTTP\\IncomingRequest\:\:getGet\(\) return type has no value type specified in iterable type array\.$#' + message: '#^Method CodeIgniter\\HTTP\\IncomingRequest\:\:getGetPost\(\) return type has no value type specified in iterable type array\.$#' count: 1 path: ../../system/HTTP/IncomingRequest.php - - message: '#^Method CodeIgniter\\HTTP\\IncomingRequest\:\:getGetPost\(\) has parameter \$flags with no value type specified in iterable type array\.$#' + message: '#^Method CodeIgniter\\HTTP\\IncomingRequest\:\:getGet\(\) has parameter \$flags with no value type specified in iterable type array\.$#' count: 1 path: ../../system/HTTP/IncomingRequest.php - - message: '#^Method CodeIgniter\\HTTP\\IncomingRequest\:\:getGetPost\(\) has parameter \$index with no value type specified in iterable type array\.$#' + message: '#^Method CodeIgniter\\HTTP\\IncomingRequest\:\:getGet\(\) has parameter \$index with no value type specified in iterable type array\.$#' count: 1 path: ../../system/HTTP/IncomingRequest.php - - message: '#^Method CodeIgniter\\HTTP\\IncomingRequest\:\:getGetPost\(\) return type has no value type specified in iterable type array\.$#' + message: '#^Method CodeIgniter\\HTTP\\IncomingRequest\:\:getGet\(\) return type has no value type specified in iterable type array\.$#' count: 1 path: ../../system/HTTP/IncomingRequest.php @@ -3128,52 +2948,52 @@ parameters: path: ../../system/HTTP/IncomingRequest.php - - message: '#^Method CodeIgniter\\HTTP\\IncomingRequest\:\:getPost\(\) has parameter \$flags with no value type specified in iterable type array\.$#' + message: '#^Method CodeIgniter\\HTTP\\IncomingRequest\:\:getPostGet\(\) has parameter \$flags with no value type specified in iterable type array\.$#' count: 1 path: ../../system/HTTP/IncomingRequest.php - - message: '#^Method CodeIgniter\\HTTP\\IncomingRequest\:\:getPost\(\) has parameter \$index with no value type specified in iterable type array\.$#' + message: '#^Method CodeIgniter\\HTTP\\IncomingRequest\:\:getPostGet\(\) has parameter \$index with no value type specified in iterable type array\.$#' count: 1 path: ../../system/HTTP/IncomingRequest.php - - message: '#^Method CodeIgniter\\HTTP\\IncomingRequest\:\:getPost\(\) return type has no value type specified in iterable type array\.$#' + message: '#^Method CodeIgniter\\HTTP\\IncomingRequest\:\:getPostGet\(\) return type has no value type specified in iterable type array\.$#' count: 1 path: ../../system/HTTP/IncomingRequest.php - - message: '#^Method CodeIgniter\\HTTP\\IncomingRequest\:\:getPostGet\(\) has parameter \$flags with no value type specified in iterable type array\.$#' + message: '#^Method CodeIgniter\\HTTP\\IncomingRequest\:\:getPost\(\) has parameter \$flags with no value type specified in iterable type array\.$#' count: 1 path: ../../system/HTTP/IncomingRequest.php - - message: '#^Method CodeIgniter\\HTTP\\IncomingRequest\:\:getPostGet\(\) has parameter \$index with no value type specified in iterable type array\.$#' + message: '#^Method CodeIgniter\\HTTP\\IncomingRequest\:\:getPost\(\) has parameter \$index with no value type specified in iterable type array\.$#' count: 1 path: ../../system/HTTP/IncomingRequest.php - - message: '#^Method CodeIgniter\\HTTP\\IncomingRequest\:\:getPostGet\(\) return type has no value type specified in iterable type array\.$#' + message: '#^Method CodeIgniter\\HTTP\\IncomingRequest\:\:getPost\(\) return type has no value type specified in iterable type array\.$#' count: 1 path: ../../system/HTTP/IncomingRequest.php - - message: '#^Method CodeIgniter\\HTTP\\IncomingRequest\:\:getRawInput\(\) return type has no value type specified in iterable type array\.$#' + message: '#^Method CodeIgniter\\HTTP\\IncomingRequest\:\:getRawInputVar\(\) has parameter \$flags with no value type specified in iterable type array\.$#' count: 1 path: ../../system/HTTP/IncomingRequest.php - - message: '#^Method CodeIgniter\\HTTP\\IncomingRequest\:\:getRawInputVar\(\) has parameter \$flags with no value type specified in iterable type array\.$#' + message: '#^Method CodeIgniter\\HTTP\\IncomingRequest\:\:getRawInputVar\(\) has parameter \$index with no value type specified in iterable type array\.$#' count: 1 path: ../../system/HTTP/IncomingRequest.php - - message: '#^Method CodeIgniter\\HTTP\\IncomingRequest\:\:getRawInputVar\(\) has parameter \$index with no value type specified in iterable type array\.$#' + message: '#^Method CodeIgniter\\HTTP\\IncomingRequest\:\:getRawInputVar\(\) return type has no value type specified in iterable type array\.$#' count: 1 path: ../../system/HTTP/IncomingRequest.php - - message: '#^Method CodeIgniter\\HTTP\\IncomingRequest\:\:getRawInputVar\(\) return type has no value type specified in iterable type array\.$#' + message: '#^Method CodeIgniter\\HTTP\\IncomingRequest\:\:getRawInput\(\) return type has no value type specified in iterable type array\.$#' count: 1 path: ../../system/HTTP/IncomingRequest.php @@ -3257,11 +3077,6 @@ parameters: count: 1 path: ../../system/HTTP/Negotiate.php - - - message: '#^Method CodeIgniter\\HTTP\\Negotiate\:\:match\(\) has parameter \$acceptable with no value type specified in iterable type array\.$#' - count: 1 - path: ../../system/HTTP/Negotiate.php - - message: '#^Method CodeIgniter\\HTTP\\Negotiate\:\:matchLocales\(\) has parameter \$acceptable with no value type specified in iterable type array\.$#' count: 1 @@ -3292,6 +3107,11 @@ parameters: count: 1 path: ../../system/HTTP/Negotiate.php + - + message: '#^Method CodeIgniter\\HTTP\\Negotiate\:\:match\(\) has parameter \$acceptable with no value type specified in iterable type array\.$#' + count: 1 + path: ../../system/HTTP/Negotiate.php + - message: '#^Method CodeIgniter\\HTTP\\Negotiate\:\:media\(\) has parameter \$supported with no value type specified in iterable type array\.$#' count: 1 @@ -4002,76 +3822,6 @@ parameters: count: 1 path: ../../system/Images/Image.php - - - message: '#^Method CodeIgniter\\Model\:\:__call\(\) has parameter \$params with no value type specified in iterable type array\.$#' - count: 1 - path: ../../system/Model.php - - - - message: '#^Method CodeIgniter\\Model\:\:__call\(\) return type has no value type specified in iterable type array\.$#' - count: 1 - path: ../../system/Model.php - - - - message: '#^Method CodeIgniter\\Model\:\:__get\(\) return type has no value type specified in iterable type array\.$#' - count: 1 - path: ../../system/Model.php - - - - message: '#^Method CodeIgniter\\Model\:\:doDelete\(\) has parameter \$id with no value type specified in iterable type array\.$#' - count: 1 - path: ../../system/Model.php - - - - message: '#^Method CodeIgniter\\Model\:\:doFind\(\) has parameter \$id with no value type specified in iterable type array\.$#' - count: 1 - path: ../../system/Model.php - - - - message: '#^Method CodeIgniter\\Model\:\:doInsertBatch\(\) has parameter \$set with no value type specified in iterable type array\.$#' - count: 1 - path: ../../system/Model.php - - - - message: '#^Method CodeIgniter\\Model\:\:doProtectFieldsForInsert\(\) return type has no value type specified in iterable type array\.$#' - count: 1 - path: ../../system/Model.php - - - - message: '#^Method CodeIgniter\\Model\:\:doUpdate\(\) has parameter \$id with no value type specified in iterable type array\.$#' - count: 1 - path: ../../system/Model.php - - - - message: '#^Method CodeIgniter\\Model\:\:doUpdateBatch\(\) has parameter \$set with no value type specified in iterable type array\.$#' - count: 1 - path: ../../system/Model.php - - - - message: '#^Method CodeIgniter\\Model\:\:getIdValue\(\) return type has no value type specified in iterable type array\.$#' - count: 1 - path: ../../system/Model.php - - - - message: '#^Method CodeIgniter\\Model\:\:set\(\) has parameter \$key with no value type specified in iterable type array\.$#' - count: 1 - path: ../../system/Model.php - - - - message: '#^Method CodeIgniter\\Model\:\:shouldUpdate\(\) has parameter \$row with no value type specified in iterable type array\.$#' - count: 1 - path: ../../system/Model.php - - - - message: '#^Method CodeIgniter\\Model\:\:update\(\) has parameter \$id with no value type specified in iterable type array\.$#' - count: 1 - path: ../../system/Model.php - - - - message: '#^Property CodeIgniter\\Model\:\:\$escape type has no value type specified in iterable type array\.$#' - count: 1 - path: ../../system/Model.php - - message: '#^Method CodeIgniter\\Modules\\Modules\:\:__set_state\(\) has parameter \$array with no value type specified in iterable type array\.$#' count: 1 @@ -4183,17 +3933,17 @@ parameters: path: ../../system/Router/AutoRouterInterface.php - - message: '#^Method CodeIgniter\\Router\\RouteCollection\:\:add\(\) has parameter \$options with no value type specified in iterable type array\.$#' + message: '#^Method CodeIgniter\\Router\\RouteCollection\:\:addPlaceholder\(\) has parameter \$placeholder with no value type specified in iterable type array\.$#' count: 1 path: ../../system/Router/RouteCollection.php - - message: '#^Method CodeIgniter\\Router\\RouteCollection\:\:add\(\) has parameter \$to with no value type specified in iterable type array\.$#' + message: '#^Method CodeIgniter\\Router\\RouteCollection\:\:add\(\) has parameter \$options with no value type specified in iterable type array\.$#' count: 1 path: ../../system/Router/RouteCollection.php - - message: '#^Method CodeIgniter\\Router\\RouteCollection\:\:addPlaceholder\(\) has parameter \$placeholder with no value type specified in iterable type array\.$#' + message: '#^Method CodeIgniter\\Router\\RouteCollection\:\:add\(\) has parameter \$to with no value type specified in iterable type array\.$#' count: 1 path: ../../system/Router/RouteCollection.php @@ -4238,17 +3988,17 @@ parameters: path: ../../system/Router/RouteCollection.php - - message: '#^Method CodeIgniter\\Router\\RouteCollection\:\:get\(\) has parameter \$options with no value type specified in iterable type array\.$#' + message: '#^Method CodeIgniter\\Router\\RouteCollection\:\:getRoutes\(\) return type has no value type specified in iterable type array\.$#' count: 1 path: ../../system/Router/RouteCollection.php - - message: '#^Method CodeIgniter\\Router\\RouteCollection\:\:get\(\) has parameter \$to with no value type specified in iterable type array\.$#' + message: '#^Method CodeIgniter\\Router\\RouteCollection\:\:get\(\) has parameter \$options with no value type specified in iterable type array\.$#' count: 1 path: ../../system/Router/RouteCollection.php - - message: '#^Method CodeIgniter\\Router\\RouteCollection\:\:getRoutes\(\) return type has no value type specified in iterable type array\.$#' + message: '#^Method CodeIgniter\\Router\\RouteCollection\:\:get\(\) has parameter \$to with no value type specified in iterable type array\.$#' count: 1 path: ../../system/Router/RouteCollection.php @@ -4378,17 +4128,17 @@ parameters: path: ../../system/Router/RouteCollection.php - - message: '#^Method CodeIgniter\\Router\\RouteCollectionInterface\:\:add\(\) has parameter \$options with no value type specified in iterable type array\.$#' + message: '#^Method CodeIgniter\\Router\\RouteCollectionInterface\:\:addPlaceholder\(\) has parameter \$placeholder with no value type specified in iterable type array\.$#' count: 1 path: ../../system/Router/RouteCollectionInterface.php - - message: '#^Method CodeIgniter\\Router\\RouteCollectionInterface\:\:add\(\) has parameter \$to with no value type specified in iterable type array\.$#' + message: '#^Method CodeIgniter\\Router\\RouteCollectionInterface\:\:add\(\) has parameter \$options with no value type specified in iterable type array\.$#' count: 1 path: ../../system/Router/RouteCollectionInterface.php - - message: '#^Method CodeIgniter\\Router\\RouteCollectionInterface\:\:addPlaceholder\(\) has parameter \$placeholder with no value type specified in iterable type array\.$#' + message: '#^Method CodeIgniter\\Router\\RouteCollectionInterface\:\:add\(\) has parameter \$to with no value type specified in iterable type array\.$#' count: 1 path: ../../system/Router/RouteCollectionInterface.php @@ -4398,12 +4148,12 @@ parameters: path: ../../system/Router/RouteCollectionInterface.php - - message: '#^Method CodeIgniter\\Router\\Router\:\:getMatchedRoute\(\) return type has no value type specified in iterable type array\.$#' + message: '#^Method CodeIgniter\\Router\\Router\:\:getMatchedRouteOptions\(\) return type has no value type specified in iterable type array\.$#' count: 1 path: ../../system/Router/Router.php - - message: '#^Method CodeIgniter\\Router\\Router\:\:getMatchedRouteOptions\(\) return type has no value type specified in iterable type array\.$#' + message: '#^Method CodeIgniter\\Router\\Router\:\:getMatchedRoute\(\) return type has no value type specified in iterable type array\.$#' count: 1 path: ../../system/Router/Router.php @@ -4518,12 +4268,12 @@ parameters: path: ../../system/Test/Fabricator.php - - message: '#^Method CodeIgniter\\Test\\Fabricator\:\:create\(\) return type has no value type specified in iterable type array\.$#' + message: '#^Method CodeIgniter\\Test\\Fabricator\:\:createMock\(\) return type has no value type specified in iterable type array\.$#' count: 1 path: ../../system/Test/Fabricator.php - - message: '#^Method CodeIgniter\\Test\\Fabricator\:\:createMock\(\) return type has no value type specified in iterable type array\.$#' + message: '#^Method CodeIgniter\\Test\\Fabricator\:\:create\(\) return type has no value type specified in iterable type array\.$#' count: 1 path: ../../system/Test/Fabricator.php @@ -4538,12 +4288,12 @@ parameters: path: ../../system/Test/Fabricator.php - - message: '#^Method CodeIgniter\\Test\\Fabricator\:\:make\(\) return type has no value type specified in iterable type array\.$#' + message: '#^Method CodeIgniter\\Test\\Fabricator\:\:makeArray\(\) return type has no value type specified in iterable type array\.$#' count: 1 path: ../../system/Test/Fabricator.php - - message: '#^Method CodeIgniter\\Test\\Fabricator\:\:makeArray\(\) return type has no value type specified in iterable type array\.$#' + message: '#^Method CodeIgniter\\Test\\Fabricator\:\:make\(\) return type has no value type specified in iterable type array\.$#' count: 1 path: ../../system/Test/Fabricator.php @@ -5668,12 +5418,12 @@ parameters: path: ../../tests/system/HTTP/ResponseCookieTest.php - - message: '#^Method CodeIgniter\\HTTP\\ResponseTest\:\:provideRedirect\(\) return type has no value type specified in iterable type iterable\.$#' + message: '#^Method CodeIgniter\\HTTP\\ResponseTest\:\:provideRedirectWithIIS\(\) return type has no value type specified in iterable type iterable\.$#' count: 1 path: ../../tests/system/HTTP/ResponseTest.php - - message: '#^Method CodeIgniter\\HTTP\\ResponseTest\:\:provideRedirectWithIIS\(\) return type has no value type specified in iterable type iterable\.$#' + message: '#^Method CodeIgniter\\HTTP\\ResponseTest\:\:provideRedirect\(\) return type has no value type specified in iterable type iterable\.$#' count: 1 path: ../../tests/system/HTTP/ResponseTest.php @@ -5912,11 +5662,6 @@ parameters: count: 1 path: ../../tests/system/Helpers/URLHelper/CurrentUrlTest.php - - - message: '#^Method CodeIgniter\\Helpers\\URLHelper\\MiscUrlTest\:\:provideAnchor\(\) return type has no value type specified in iterable type iterable\.$#' - count: 1 - path: ../../tests/system/Helpers/URLHelper/MiscUrlTest.php - - message: '#^Method CodeIgniter\\Helpers\\URLHelper\\MiscUrlTest\:\:provideAnchorExamples\(\) return type has no value type specified in iterable type iterable\.$#' count: 1 @@ -5937,6 +5682,11 @@ parameters: count: 1 path: ../../tests/system/Helpers/URLHelper/MiscUrlTest.php + - + message: '#^Method CodeIgniter\\Helpers\\URLHelper\\MiscUrlTest\:\:provideAnchor\(\) return type has no value type specified in iterable type iterable\.$#' + count: 1 + path: ../../tests/system/Helpers/URLHelper/MiscUrlTest.php + - message: '#^Method CodeIgniter\\Helpers\\URLHelper\\MiscUrlTest\:\:provideAutoLinkEmail\(\) return type has no value type specified in iterable type iterable\.$#' count: 1 @@ -5973,12 +5723,12 @@ parameters: path: ../../tests/system/Helpers/URLHelper/MiscUrlTest.php - - message: '#^Method CodeIgniter\\Helpers\\URLHelper\\MiscUrlTest\:\:provideUrlTo\(\) return type has no value type specified in iterable type iterable\.$#' + message: '#^Method CodeIgniter\\Helpers\\URLHelper\\MiscUrlTest\:\:provideUrlToThrowsOnEmptyOrMissingRoute\(\) return type has no value type specified in iterable type iterable\.$#' count: 1 path: ../../tests/system/Helpers/URLHelper/MiscUrlTest.php - - message: '#^Method CodeIgniter\\Helpers\\URLHelper\\MiscUrlTest\:\:provideUrlToThrowsOnEmptyOrMissingRoute\(\) return type has no value type specified in iterable type iterable\.$#' + message: '#^Method CodeIgniter\\Helpers\\URLHelper\\MiscUrlTest\:\:provideUrlTo\(\) return type has no value type specified in iterable type iterable\.$#' count: 1 path: ../../tests/system/Helpers/URLHelper/MiscUrlTest.php @@ -6333,22 +6083,22 @@ parameters: path: ../../tests/system/Validation/FormatRulesTest.php - - message: '#^Method CodeIgniter\\Validation\\FormatRulesTest\:\:provideAlpha\(\) return type has no value type specified in iterable type iterable\.$#' + message: '#^Method CodeIgniter\\Validation\\FormatRulesTest\:\:provideAlphaDash\(\) return type has no value type specified in iterable type iterable\.$#' count: 1 path: ../../tests/system/Validation/FormatRulesTest.php - - message: '#^Method CodeIgniter\\Validation\\FormatRulesTest\:\:provideAlphaDash\(\) return type has no value type specified in iterable type iterable\.$#' + message: '#^Method CodeIgniter\\Validation\\FormatRulesTest\:\:provideAlphaNumericPunct\(\) return type has no value type specified in iterable type iterable\.$#' count: 1 path: ../../tests/system/Validation/FormatRulesTest.php - - message: '#^Method CodeIgniter\\Validation\\FormatRulesTest\:\:provideAlphaNumericPunct\(\) return type has no value type specified in iterable type iterable\.$#' + message: '#^Method CodeIgniter\\Validation\\FormatRulesTest\:\:provideAlphaSpace\(\) return type has no value type specified in iterable type iterable\.$#' count: 1 path: ../../tests/system/Validation/FormatRulesTest.php - - message: '#^Method CodeIgniter\\Validation\\FormatRulesTest\:\:provideAlphaSpace\(\) return type has no value type specified in iterable type iterable\.$#' + message: '#^Method CodeIgniter\\Validation\\FormatRulesTest\:\:provideAlpha\(\) return type has no value type specified in iterable type iterable\.$#' count: 1 path: ../../tests/system/Validation/FormatRulesTest.php @@ -6383,12 +6133,12 @@ parameters: path: ../../tests/system/Validation/FormatRulesTest.php - - message: '#^Method CodeIgniter\\Validation\\FormatRulesTest\:\:provideNatural\(\) return type has no value type specified in iterable type iterable\.$#' + message: '#^Method CodeIgniter\\Validation\\FormatRulesTest\:\:provideNaturalNoZero\(\) return type has no value type specified in iterable type iterable\.$#' count: 1 path: ../../tests/system/Validation/FormatRulesTest.php - - message: '#^Method CodeIgniter\\Validation\\FormatRulesTest\:\:provideNaturalNoZero\(\) return type has no value type specified in iterable type iterable\.$#' + message: '#^Method CodeIgniter\\Validation\\FormatRulesTest\:\:provideNatural\(\) return type has no value type specified in iterable type iterable\.$#' count: 1 path: ../../tests/system/Validation/FormatRulesTest.php @@ -6453,12 +6203,12 @@ parameters: path: ../../tests/system/Validation/RulesTest.php - - message: '#^Method CodeIgniter\\Validation\\RulesTest\:\:provideGreaterThan\(\) return type has no value type specified in iterable type iterable\.$#' + message: '#^Method CodeIgniter\\Validation\\RulesTest\:\:provideGreaterThanEqual\(\) return type has no value type specified in iterable type iterable\.$#' count: 1 path: ../../tests/system/Validation/RulesTest.php - - message: '#^Method CodeIgniter\\Validation\\RulesTest\:\:provideGreaterThanEqual\(\) return type has no value type specified in iterable type iterable\.$#' + message: '#^Method CodeIgniter\\Validation\\RulesTest\:\:provideGreaterThan\(\) return type has no value type specified in iterable type iterable\.$#' count: 1 path: ../../tests/system/Validation/RulesTest.php @@ -6473,22 +6223,22 @@ parameters: path: ../../tests/system/Validation/RulesTest.php - - message: '#^Method CodeIgniter\\Validation\\RulesTest\:\:provideLessThan\(\) return type has no value type specified in iterable type iterable\.$#' + message: '#^Method CodeIgniter\\Validation\\RulesTest\:\:provideLessThanEqual\(\) return type has no value type specified in iterable type iterable\.$#' count: 1 path: ../../tests/system/Validation/RulesTest.php - - message: '#^Method CodeIgniter\\Validation\\RulesTest\:\:provideLessThanEqual\(\) return type has no value type specified in iterable type iterable\.$#' + message: '#^Method CodeIgniter\\Validation\\RulesTest\:\:provideLessThan\(\) return type has no value type specified in iterable type iterable\.$#' count: 1 path: ../../tests/system/Validation/RulesTest.php - - message: '#^Method CodeIgniter\\Validation\\RulesTest\:\:provideMatches\(\) return type has no value type specified in iterable type iterable\.$#' + message: '#^Method CodeIgniter\\Validation\\RulesTest\:\:provideMatchesNestedCases\(\) return type has no value type specified in iterable type iterable\.$#' count: 1 path: ../../tests/system/Validation/RulesTest.php - - message: '#^Method CodeIgniter\\Validation\\RulesTest\:\:provideMatchesNestedCases\(\) return type has no value type specified in iterable type iterable\.$#' + message: '#^Method CodeIgniter\\Validation\\RulesTest\:\:provideMatches\(\) return type has no value type specified in iterable type iterable\.$#' count: 1 path: ../../tests/system/Validation/RulesTest.php @@ -6503,47 +6253,47 @@ parameters: path: ../../tests/system/Validation/RulesTest.php - - message: '#^Method CodeIgniter\\Validation\\RulesTest\:\:provideRequired\(\) return type has no value type specified in iterable type iterable\.$#' + message: '#^Method CodeIgniter\\Validation\\RulesTest\:\:provideRequiredWithAndOtherRuleWithValueZero\(\) return type has no value type specified in iterable type iterable\.$#' count: 1 path: ../../tests/system/Validation/RulesTest.php - - message: '#^Method CodeIgniter\\Validation\\RulesTest\:\:provideRequiredWith\(\) return type has no value type specified in iterable type iterable\.$#' + message: '#^Method CodeIgniter\\Validation\\RulesTest\:\:provideRequiredWithAndOtherRules\(\) return type has no value type specified in iterable type iterable\.$#' count: 1 path: ../../tests/system/Validation/RulesTest.php - - message: '#^Method CodeIgniter\\Validation\\RulesTest\:\:provideRequiredWithAndOtherRuleWithValueZero\(\) return type has no value type specified in iterable type iterable\.$#' + message: '#^Method CodeIgniter\\Validation\\RulesTest\:\:provideRequiredWith\(\) return type has no value type specified in iterable type iterable\.$#' count: 1 path: ../../tests/system/Validation/RulesTest.php - - message: '#^Method CodeIgniter\\Validation\\RulesTest\:\:provideRequiredWithAndOtherRules\(\) return type has no value type specified in iterable type iterable\.$#' + message: '#^Method CodeIgniter\\Validation\\RulesTest\:\:provideRequiredWithoutMultipleWithoutFields\(\) return type has no value type specified in iterable type iterable\.$#' count: 1 path: ../../tests/system/Validation/RulesTest.php - - message: '#^Method CodeIgniter\\Validation\\RulesTest\:\:provideRequiredWithout\(\) return type has no value type specified in iterable type iterable\.$#' + message: '#^Method CodeIgniter\\Validation\\RulesTest\:\:provideRequiredWithoutMultiple\(\) return type has no value type specified in iterable type iterable\.$#' count: 1 path: ../../tests/system/Validation/RulesTest.php - - message: '#^Method CodeIgniter\\Validation\\RulesTest\:\:provideRequiredWithoutMultiple\(\) return type has no value type specified in iterable type iterable\.$#' + message: '#^Method CodeIgniter\\Validation\\RulesTest\:\:provideRequiredWithout\(\) return type has no value type specified in iterable type iterable\.$#' count: 1 path: ../../tests/system/Validation/RulesTest.php - - message: '#^Method CodeIgniter\\Validation\\RulesTest\:\:provideRequiredWithoutMultipleWithoutFields\(\) return type has no value type specified in iterable type iterable\.$#' + message: '#^Method CodeIgniter\\Validation\\RulesTest\:\:provideRequired\(\) return type has no value type specified in iterable type iterable\.$#' count: 1 path: ../../tests/system/Validation/RulesTest.php - - message: '#^Method CodeIgniter\\Validation\\RulesTest\:\:testDiffers\(\) has parameter \$data with no value type specified in iterable type array\.$#' + message: '#^Method CodeIgniter\\Validation\\RulesTest\:\:testDiffersNested\(\) has parameter \$data with no value type specified in iterable type array\.$#' count: 1 path: ../../tests/system/Validation/RulesTest.php - - message: '#^Method CodeIgniter\\Validation\\RulesTest\:\:testDiffersNested\(\) has parameter \$data with no value type specified in iterable type array\.$#' + message: '#^Method CodeIgniter\\Validation\\RulesTest\:\:testDiffers\(\) has parameter \$data with no value type specified in iterable type array\.$#' count: 1 path: ../../tests/system/Validation/RulesTest.php @@ -6573,12 +6323,12 @@ parameters: path: ../../tests/system/Validation/RulesTest.php - - message: '#^Method CodeIgniter\\Validation\\RulesTest\:\:testMatches\(\) has parameter \$data with no value type specified in iterable type array\.$#' + message: '#^Method CodeIgniter\\Validation\\RulesTest\:\:testMatchesNested\(\) has parameter \$data with no value type specified in iterable type array\.$#' count: 1 path: ../../tests/system/Validation/RulesTest.php - - message: '#^Method CodeIgniter\\Validation\\RulesTest\:\:testMatchesNested\(\) has parameter \$data with no value type specified in iterable type array\.$#' + message: '#^Method CodeIgniter\\Validation\\RulesTest\:\:testMatches\(\) has parameter \$data with no value type specified in iterable type array\.$#' count: 1 path: ../../tests/system/Validation/RulesTest.php @@ -6593,22 +6343,22 @@ parameters: path: ../../tests/system/Validation/RulesTest.php - - message: '#^Method CodeIgniter\\Validation\\RulesTest\:\:testRequired\(\) has parameter \$data with no value type specified in iterable type array\.$#' + message: '#^Method CodeIgniter\\Validation\\RulesTest\:\:testRequiredWithAndOtherRuleWithValueZero\(\) has parameter \$data with no value type specified in iterable type array\.$#' count: 1 path: ../../tests/system/Validation/RulesTest.php - - message: '#^Method CodeIgniter\\Validation\\RulesTest\:\:testRequiredWithAndOtherRuleWithValueZero\(\) has parameter \$data with no value type specified in iterable type array\.$#' + message: '#^Method CodeIgniter\\Validation\\RulesTest\:\:testRequiredWithAndOtherRules\(\) has parameter \$data with no value type specified in iterable type array\.$#' count: 1 path: ../../tests/system/Validation/RulesTest.php - - message: '#^Method CodeIgniter\\Validation\\RulesTest\:\:testRequiredWithAndOtherRules\(\) has parameter \$data with no value type specified in iterable type array\.$#' + message: '#^Method CodeIgniter\\Validation\\RulesTest\:\:testRequiredWithoutMultipleWithoutFields\(\) has parameter \$data with no value type specified in iterable type array\.$#' count: 1 path: ../../tests/system/Validation/RulesTest.php - - message: '#^Method CodeIgniter\\Validation\\RulesTest\:\:testRequiredWithoutMultipleWithoutFields\(\) has parameter \$data with no value type specified in iterable type array\.$#' + message: '#^Method CodeIgniter\\Validation\\RulesTest\:\:testRequired\(\) has parameter \$data with no value type specified in iterable type array\.$#' count: 1 path: ../../tests/system/Validation/RulesTest.php From 9b5e64b7dd23a0289232f7c9a99ef9860c5b7f9b Mon Sep 17 00:00:00 2001 From: neznaika0 Date: Thu, 11 Dec 2025 23:02:35 +0300 Subject: [PATCH 2/3] refactor: Apply suggestions (revert) --- deptrac.yaml | 1 + system/BaseModel.php | 5 ++--- system/Model.php | 3 +++ 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/deptrac.yaml b/deptrac.yaml index c70f4d7126cc..a35887183f05 100644 --- a/deptrac.yaml +++ b/deptrac.yaml @@ -209,6 +209,7 @@ deptrac: - I18n Model: - Database + - DataCaster - DataConverter - Entity - I18n diff --git a/system/BaseModel.php b/system/BaseModel.php index bf879b552276..12c700170bca 100644 --- a/system/BaseModel.php +++ b/system/BaseModel.php @@ -212,8 +212,8 @@ abstract class BaseModel protected bool $updateOnlyChanged = true; /** - * Rules used to validate data - * in $this->insert(), $this->update(), $this->save() methods. + * Rules used to validate data in insert(), update(), save(), + * insertBatch(), and updateBatch() methods. * * The array must match the format of data passed to the `Validation` * library. @@ -973,7 +973,6 @@ public function update($id = null, $row = null): bool throw new InvalidArgumentException('update(): argument #1 ($id) should not be boolean.'); } - // if (is_numeric($id) || is_string($id)) { if (! in_array($id, [null, 0, '0'], true) && (is_numeric($id) || is_string($id))) { $id = [$id]; } diff --git a/system/Model.php b/system/Model.php index 8f6888a69951..108ff17cf849 100644 --- a/system/Model.php +++ b/system/Model.php @@ -506,6 +506,9 @@ public function countAllResults(bool $reset = true, bool $test = false) $this->builder()->where($this->table . '.' . $this->deletedField, null); } + // When $reset === false, the $tempUseSoftDeletes will be + // dependent on $useSoftDeletes value because we don't + // want to add the same "where" condition for the second time. $this->tempUseSoftDeletes = $reset ? $this->useSoftDeletes : ($this->useSoftDeletes ? false : $this->useSoftDeletes); From 36fd340d0d2d63e6855a152b408c06d6974b50d2 Mon Sep 17 00:00:00 2001 From: neznaika0 Date: Fri, 12 Dec 2025 00:02:18 +0300 Subject: [PATCH 3/3] fix: Revert check ID on update --- system/BaseModel.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/system/BaseModel.php b/system/BaseModel.php index 12c700170bca..6b2edc43947f 100644 --- a/system/BaseModel.php +++ b/system/BaseModel.php @@ -973,7 +973,7 @@ public function update($id = null, $row = null): bool throw new InvalidArgumentException('update(): argument #1 ($id) should not be boolean.'); } - if (! in_array($id, [null, 0, '0'], true) && (is_numeric($id) || is_string($id))) { + if (is_numeric($id) || is_string($id)) { $id = [$id]; }