diff --git a/system/Database/BaseBuilder.php b/system/Database/BaseBuilder.php index 1aebd7ae0d9b..5b03b0510b5f 100644 --- a/system/Database/BaseBuilder.php +++ b/system/Database/BaseBuilder.php @@ -57,35 +57,35 @@ class BaseBuilder /** * QB FROM data * - * @var array + * @var list */ protected $QBFrom = []; /** * QB JOIN data * - * @var array + * @var list */ protected $QBJoin = []; /** * QB WHERE data * - * @var array + * @var list */ protected $QBWhere = []; /** * QB GROUP BY data * - * @var array + * @var list */ public $QBGroupBy = []; /** * QB HAVING data * - * @var array + * @var list */ protected $QBHaving = []; @@ -114,7 +114,7 @@ class BaseBuilder /** * QB ORDER BY data * - * @var array|string|null + * @var list|string|null */ public $QBOrderBy = []; @@ -168,10 +168,10 @@ class BaseBuilder * and is reset by resetWrite() * * @var array{ - * updateFieldsAdditional?: array, + * updateFieldsAdditional?: array, * tableIdentity?: string, - * updateFields?: array, - * constraints?: array, + * updateFields?: array, + * constraints?: array, * setQueryAsData?: string, * sql?: string, * alias?: string, @@ -204,7 +204,7 @@ class BaseBuilder /** * ORDER BY random keyword * - * @var array + * @var list */ protected $randomKeyword = [ 'RAND()', @@ -226,7 +226,7 @@ class BaseBuilder * their values for later binding * in the Query object. * - * @var array + * @var array */ protected $binds = []; @@ -234,7 +234,7 @@ class BaseBuilder * Collects the key count for named parameters * in the Query object. * - * @var array + * @var array */ protected $bindsKeyCount = []; @@ -272,7 +272,7 @@ class BaseBuilder /** * Tables relation types * - * @var array + * @var list */ protected $joinTypes = [ 'LEFT', @@ -300,7 +300,8 @@ class BaseBuilder /** * Constructor * - * @param array|string|TableName $tableName tablename or tablenames with or without aliases + * @param array|string|TableName $tableName tablename or tablenames with or without aliases + * @param array|null $options * * Examples of $tableName: `mytable`, `jobs j`, `jobs j, users u`, `['jobs j','users u']` * @@ -371,6 +372,8 @@ public function getTable(): string /** * Returns an array of bind values and their * named parameters for binding in the Query object later. + * + * @return array */ public function getBinds(): array { @@ -578,7 +581,7 @@ public function distinct(bool $val = true) /** * Generates the FROM portion of the query * - * @param array|string $from + * @param array|string|null $from */ public function from($from, bool $overwrite = false): self { @@ -708,8 +711,8 @@ public function join(string $table, $cond, string $type = '', ?bool $escape = nu * Generates the WHERE portion of the query. * Separates multiple calls with 'AND'. * - * @param array|RawSql|string $key - * @param mixed $value + * @param array|RawSql|string $key + * @param mixed $value * * @return $this */ @@ -724,8 +727,8 @@ public function where($key, $value = null, ?bool $escape = null) * Generates the WHERE portion of the query. * Separates multiple calls with 'OR'. * - * @param array|RawSql|string $key - * @param mixed $value + * @param array|RawSql|string $key + * @param mixed $value * * @return $this */ @@ -740,8 +743,8 @@ public function orWhere($key, $value = null, ?bool $escape = null) * @used-by having() * @used-by orHaving() * - * @param array|RawSql|string $key - * @param mixed $value + * @param array|RawSql|string $key + * @param mixed $value * * @return $this */ @@ -843,7 +846,7 @@ protected function whereHaving(string $qbKey, $key, $value = null, string $type * Generates a WHERE field IN('item', 'item') SQL query, * joined with 'AND' if appropriate. * - * @param array|BaseBuilder|(Closure(BaseBuilder): BaseBuilder)|null $values The values searched on, or anonymous function with subquery + * @param array|BaseBuilder|(Closure(BaseBuilder): BaseBuilder)|null $values The values searched on, or anonymous function with subquery * * @return $this */ @@ -856,7 +859,7 @@ public function whereIn(?string $key = null, $values = null, ?bool $escape = nul * Generates a WHERE field IN('item', 'item') SQL query, * joined with 'OR' if appropriate. * - * @param array|BaseBuilder|(Closure(BaseBuilder): BaseBuilder)|null $values The values searched on, or anonymous function with subquery + * @param array|BaseBuilder|(Closure(BaseBuilder): BaseBuilder)|null $values The values searched on, or anonymous function with subquery * * @return $this */ @@ -869,7 +872,7 @@ public function orWhereIn(?string $key = null, $values = null, ?bool $escape = n * Generates a WHERE field NOT IN('item', 'item') SQL query, * joined with 'AND' if appropriate. * - * @param array|BaseBuilder|(Closure(BaseBuilder): BaseBuilder)|null $values The values searched on, or anonymous function with subquery + * @param array|BaseBuilder|(Closure(BaseBuilder): BaseBuilder)|null $values The values searched on, or anonymous function with subquery * * @return $this */ @@ -882,7 +885,7 @@ public function whereNotIn(?string $key = null, $values = null, ?bool $escape = * Generates a WHERE field NOT IN('item', 'item') SQL query, * joined with 'OR' if appropriate. * - * @param array|BaseBuilder|(Closure(BaseBuilder): BaseBuilder)|null $values The values searched on, or anonymous function with subquery + * @param array|BaseBuilder|(Closure(BaseBuilder): BaseBuilder)|null $values The values searched on, or anonymous function with subquery * * @return $this */ @@ -895,7 +898,7 @@ public function orWhereNotIn(?string $key = null, $values = null, ?bool $escape * Generates a HAVING field IN('item', 'item') SQL query, * joined with 'AND' if appropriate. * - * @param array|BaseBuilder|(Closure(BaseBuilder): BaseBuilder)|null $values The values searched on, or anonymous function with subquery + * @param array|BaseBuilder|(Closure(BaseBuilder): BaseBuilder)|null $values The values searched on, or anonymous function with subquery * * @return $this */ @@ -908,7 +911,7 @@ public function havingIn(?string $key = null, $values = null, ?bool $escape = nu * Generates a HAVING field IN('item', 'item') SQL query, * joined with 'OR' if appropriate. * - * @param array|BaseBuilder|(Closure(BaseBuilder): BaseBuilder)|null $values The values searched on, or anonymous function with subquery + * @param array|BaseBuilder|(Closure(BaseBuilder): BaseBuilder)|null $values The values searched on, or anonymous function with subquery * * @return $this */ @@ -921,7 +924,7 @@ public function orHavingIn(?string $key = null, $values = null, ?bool $escape = * Generates a HAVING field NOT IN('item', 'item') SQL query, * joined with 'AND' if appropriate. * - * @param array|BaseBuilder|(Closure(BaseBuilder):BaseBuilder)|null $values The values searched on, or anonymous function with subquery + * @param array|BaseBuilder|(Closure(BaseBuilder): BaseBuilder)|null $values The values searched on, or anonymous function with subquery * * @return $this */ @@ -934,7 +937,7 @@ public function havingNotIn(?string $key = null, $values = null, ?bool $escape = * Generates a HAVING field NOT IN('item', 'item') SQL query, * joined with 'OR' if appropriate. * - * @param array|BaseBuilder|(Closure(BaseBuilder): BaseBuilder)|null $values The values searched on, or anonymous function with subquery + * @param array|BaseBuilder|(Closure(BaseBuilder): BaseBuilder)|null $values The values searched on, or anonymous function with subquery * * @return $this */ @@ -1003,7 +1006,7 @@ protected function _whereIn(?string $key = null, $values = null, bool $not = fal * Generates a %LIKE% portion of the query. * Separates multiple calls with 'AND'. * - * @param array|RawSql|string $field + * @param array|RawSql|string $field * * @return $this */ @@ -1016,7 +1019,7 @@ public function like($field, string $match = '', string $side = 'both', ?bool $e * Generates a NOT LIKE portion of the query. * Separates multiple calls with 'AND'. * - * @param array|RawSql|string $field + * @param array|RawSql|string $field * * @return $this */ @@ -1029,7 +1032,7 @@ public function notLike($field, string $match = '', string $side = 'both', ?bool * Generates a %LIKE% portion of the query. * Separates multiple calls with 'OR'. * - * @param array|RawSql|string $field + * @param array|RawSql|string $field * * @return $this */ @@ -1042,7 +1045,7 @@ public function orLike($field, string $match = '', string $side = 'both', ?bool * Generates a NOT LIKE portion of the query. * Separates multiple calls with 'OR'. * - * @param array|RawSql|string $field + * @param array|RawSql|string $field * * @return $this */ @@ -1055,7 +1058,7 @@ public function orNotLike($field, string $match = '', string $side = 'both', ?bo * Generates a %LIKE% portion of the query. * Separates multiple calls with 'AND'. * - * @param array|RawSql|string $field + * @param array|RawSql|string $field * * @return $this */ @@ -1068,7 +1071,7 @@ public function havingLike($field, string $match = '', string $side = 'both', ?b * Generates a NOT LIKE portion of the query. * Separates multiple calls with 'AND'. * - * @param array|RawSql|string $field + * @param array|RawSql|string $field * * @return $this */ @@ -1081,7 +1084,7 @@ public function notHavingLike($field, string $match = '', string $side = 'both', * Generates a %LIKE% portion of the query. * Separates multiple calls with 'OR'. * - * @param array|RawSql|string $field + * @param array|RawSql|string $field * * @return $this */ @@ -1094,7 +1097,7 @@ public function orHavingLike($field, string $match = '', string $side = 'both', * Generates a NOT LIKE portion of the query. * Separates multiple calls with 'OR'. * - * @param array|RawSql|string $field + * @param array|RawSql|string $field * * @return $this */ @@ -1406,7 +1409,7 @@ protected function groupGetType(string $type): string } /** - * @param array|string $by + * @param array|string $by * * @return $this */ @@ -1439,8 +1442,8 @@ public function groupBy($by, ?bool $escape = null) /** * Separates multiple calls with 'AND'. * - * @param array|RawSql|string $key - * @param mixed $value + * @param array|RawSql|string $key + * @param mixed $value * * @return $this */ @@ -1452,8 +1455,8 @@ public function having($key, $value = null, ?bool $escape = null) /** * Separates multiple calls with 'OR'. * - * @param array|RawSql|string $key - * @param mixed $value + * @param array|RawSql|string $key + * @param mixed $value * * @return $this */ @@ -1562,9 +1565,9 @@ protected function _limit(string $sql, bool $offsetIgnore = false): string /** * Allows key/value pairs to be set for insert(), update() or replace(). * - * @param array|object|string $key Field name, or an array of field/value pairs, or an object - * @param mixed $value Field value, if $key is a single field - * @param bool|null $escape Whether to escape values + * @param array|object|string $key Field name, or an array of field/value pairs, or an object + * @param mixed $value Field value, if $key is a single field + * @param bool|null $escape Whether to escape values * * @return $this */ @@ -1593,6 +1596,8 @@ public function set($key, $value = '', ?bool $escape = null) /** * Returns the previously set() data, alternatively resetting it if needed. + * + * @return array|list> */ public function getSetData(bool $clean = false): array { @@ -1639,7 +1644,7 @@ protected function compileFinalQuery(string $sql): string * Compiles the select statement based on the other functions called * and runs the query * - * @return false|ResultInterface + * @return false|ResultInterface|string */ public function get(?int $limit = null, int $offset = 0, bool $reset = true) { @@ -1761,7 +1766,7 @@ public function countAllResults(bool $reset = true) /** * Compiles the set conditions and returns the sql statement * - * @return array + * @return list */ public function getCompiledQBWhere() { @@ -1771,9 +1776,9 @@ public function getCompiledQBWhere() /** * Allows the where clause, limit and offset to be added directly * - * @param array|string $where + * @param array|RawSql|string|null $where * - * @return ResultInterface + * @return false|ResultInterface|string */ public function getWhere($where = null, ?int $limit = null, ?int $offset = 0, bool $reset = true) { @@ -1861,8 +1866,8 @@ protected function batchExecute(string $renderMethod, int $batchSize = 100) /** * Allows a row or multiple rows to be set for batch inserts/upserts/updates * - * @param array|object $set - * @param string $alias alias for sql table + * @param array|object $set + * @param string $alias alias for sql table * * @return $this|null */ @@ -1944,7 +1949,7 @@ public function getCompiledUpsert() /** * Converts call to batchUpsert * - * @param array|object|null $set + * @param array|object|null $set * * @return false|int|list Number of affected rows or FALSE on failure, SQL array when testMode * @@ -1980,7 +1985,7 @@ public function upsert($set = null, ?bool $escape = null) /** * Compiles batch upsert strings and runs the queries * - * @param array|object|null $set a dataset + * @param array|object|null $set a dataset * * @return false|int|list Number of affected rows or FALSE on failure, SQL array when testMode * @@ -2069,7 +2074,7 @@ private function setAlias(string $alias): BaseBuilder * * @param list|list|string $set * @param bool $addToDefault adds update fields to the default ones - * @param array|null $ignore ignores items in set + * @param list|null $ignore ignores items in set * * @return $this */ @@ -2111,7 +2116,7 @@ public function updateFields($set, bool $addToDefault = false, ?array $ignore = /** * Sets constraints for batch upsert, update * - * @param array|RawSql|string|null $set A string of columns, key value pairs, or RawSql + * @param array|RawSql|string|null $set A string of columns, key value pairs, or RawSql * * @return $this */ @@ -2147,8 +2152,8 @@ public function onConstraint($set) /** * Sets data source as a query for insertBatch()/updateBatch()/upsertBatch()/deleteBatch() * - * @param BaseBuilder|RawSql $query - * @param array|string|null $columns an array or comma delimited string of columns + * @param BaseBuilder|RawSql $query + * @param list|string|null $columns an array or comma delimited string of columns */ public function setQueryAsData($query, ?string $alias = null, $columns = null): BaseBuilder { @@ -2192,6 +2197,8 @@ public function setQueryAsData($query, ?string $alias = null, $columns = null): /** * Gets column names from a select query + * + * @return list */ protected function fieldsFromQuery(string $sql): array { @@ -2200,6 +2207,10 @@ protected function fieldsFromQuery(string $sql): array /** * Converts value array of array to array of strings + * + * @param list> $values + * + * @return list */ protected function formatValues(array $values): array { @@ -2209,7 +2220,7 @@ protected function formatValues(array $values): array /** * Compiles batch insert strings and runs the queries * - * @param array|object|null $set a dataset + * @param array|object|null $set a dataset * * @return false|int|list Number of rows inserted or FALSE on no data to perform an insert operation, SQL array when testMode */ @@ -2320,7 +2331,7 @@ public function getCompiledInsert(bool $reset = true) /** * Compiles an insert string and runs the query * - * @param array|object|null $set + * @param array|object|null $set * * @return BaseResult|bool|Query * @@ -2416,6 +2427,8 @@ protected function _insert(string $table, array $keys, array $unescapedKeys): st /** * Compiles a replace into string and runs the query * + * @param array|null $set + * * @return BaseResult|false|Query|string * * @throws DatabaseException @@ -2489,8 +2502,8 @@ public function getCompiledUpdate(bool $reset = true) /** * Compiles an update string and runs the query. * - * @param array|object|null $set - * @param array|RawSql|string|null $where + * @param array|object|null $set + * @param array|RawSql|string|null $where * * @throws DatabaseException */ @@ -2592,8 +2605,8 @@ protected function validateUpdate(): bool /** * Sets data and calls batchExecute to run queries * - * @param array|object|null $set a dataset - * @param array|RawSql|string|null $constraints + * @param array|object|null $set a dataset + * @param array|RawSql|string|null $constraints * * @return false|int|list Number of rows affected or FALSE on failure, SQL array when testMode */ @@ -2727,7 +2740,7 @@ protected function _updateBatch(string $table, array $keys, array $values): stri /** * Allows key/value pairs to be set for batch updating * - * @param array|object $key + * @param array|object $key * * @return $this * @@ -2866,8 +2879,8 @@ public function delete($where = '', ?int $limit = null, bool $resetData = true) /** * Sets data and calls batchExecute to run queries * - * @param array|object|null $set a dataset - * @param array|RawSql|null $constraints + * @param array|object|null $set a dataset + * @param array|RawSql|null $constraints * * @return false|int|list Number of rows affected or FALSE on failure, SQL array when testMode */ @@ -2903,9 +2916,9 @@ public function deleteBatch($set = null, $constraints = null, int $batchSize = 1 * * @used-by batchExecute() * - * @param string $table Protected table name - * @param list $keys QBKeys - * @param list $values QBSet + * @param string $table Protected table name + * @param list $keys QBKeys + * @param list> $values QBSet */ protected function _deleteBatch(string $table, array $keys, array $values): string { @@ -3057,7 +3070,7 @@ protected function _delete(string $table): string /** * Used to track SQL statements written with aliased tables. * - * @param array|string $table The table to inspect + * @param array|string $table The table to inspect * * @return string|null */ @@ -3327,9 +3340,9 @@ protected function unionInjection(string $sql): string /** * Takes an object as input and converts the class variables to array key/vals * - * @param array|object $object + * @param array|object $object * - * @return array + * @return array */ protected function objectToArray($object) { @@ -3355,9 +3368,9 @@ protected function objectToArray($object) /** * Takes an object as input and converts the class variables to array key/vals * - * @param array|object $object + * @param array|object $object * - * @return array + * @return array|list> */ protected function batchObjectToArray($object) { @@ -3418,7 +3431,7 @@ public function resetQuery() /** * Resets the query builder values. Called by the get() function * - * @param array $qbResetItems An array of fields to reset + * @param array $qbResetItems An array of fields to reset * * @return void */ @@ -3495,7 +3508,7 @@ protected function hasOperator(string $str): bool /** * Returns the SQL string operator * - * @return array|false|string + * @return false|list|string */ protected function getOperator(string $str, bool $list = false) { diff --git a/system/Database/OCI8/Builder.php b/system/Database/OCI8/Builder.php index 9f3fa28a95a0..118f237f597e 100644 --- a/system/Database/OCI8/Builder.php +++ b/system/Database/OCI8/Builder.php @@ -34,7 +34,7 @@ class Builder extends BaseBuilder /** * ORDER BY random keyword * - * @var array + * @var list */ protected $randomKeyword = [ '"DBMS_RANDOM"."RANDOM"', diff --git a/system/Database/Postgre/Builder.php b/system/Database/Postgre/Builder.php index 452390a8f4ab..ee0a59c63bb1 100644 --- a/system/Database/Postgre/Builder.php +++ b/system/Database/Postgre/Builder.php @@ -30,7 +30,7 @@ class Builder extends BaseBuilder /** * ORDER BY random keyword * - * @var array + * @var list */ protected $randomKeyword = [ 'RANDOM()', @@ -140,7 +140,7 @@ public function decrement(string $column, int $value = 1) * we simply do a DELETE and an INSERT on the first key/value * combo, assuming that it's either the primary key or a unique key. * - * @param array|null $set An associative array of insert values + * @param array|null $set An associative array of insert values * * @return BaseResult|false|Query|string * diff --git a/system/Database/SQLSRV/Builder.php b/system/Database/SQLSRV/Builder.php index ebc656ddad4d..d98cbe0d9d0b 100644 --- a/system/Database/SQLSRV/Builder.php +++ b/system/Database/SQLSRV/Builder.php @@ -36,7 +36,7 @@ class Builder extends BaseBuilder /** * ORDER BY random keyword * - * @var array + * @var list */ protected $randomKeyword = [ 'NEWID()', @@ -644,7 +644,7 @@ protected function compileSelect($selectOverride = false): string * Compiles the select statement based on the other functions called * and runs the query * - * @return ResultInterface + * @return false|ResultInterface|string */ public function get(?int $limit = null, int $offset = 0, bool $reset = true) { diff --git a/system/Database/SQLite3/Builder.php b/system/Database/SQLite3/Builder.php index 57dc1ae6c3ac..d31cfb493967 100644 --- a/system/Database/SQLite3/Builder.php +++ b/system/Database/SQLite3/Builder.php @@ -44,7 +44,7 @@ class Builder extends BaseBuilder /** * ORDER BY random keyword * - * @var array + * @var list */ protected $randomKeyword = [ 'RANDOM()', diff --git a/tests/system/Database/Builder/UnionTest.php b/tests/system/Database/Builder/UnionTest.php index 5711c6c3cbf7..c6d01273e2e5 100644 --- a/tests/system/Database/Builder/UnionTest.php +++ b/tests/system/Database/Builder/UnionTest.php @@ -25,11 +25,6 @@ #[Group('Others')] final class UnionTest extends CIUnitTestCase { - /** - * @var MockConnection - */ - protected $db; - protected function setUp(): void { parent::setUp(); diff --git a/tests/system/Database/Builder/WhenTest.php b/tests/system/Database/Builder/WhenTest.php index 2fc4966accb8..e902d8471fd2 100644 --- a/tests/system/Database/Builder/WhenTest.php +++ b/tests/system/Database/Builder/WhenTest.php @@ -25,11 +25,6 @@ #[Group('Others')] final class WhenTest extends CIUnitTestCase { - /** - * @var MockConnection - */ - protected $db; - protected function setUp(): void { parent::setUp(); diff --git a/tests/system/Database/Builder/WhereTest.php b/tests/system/Database/Builder/WhereTest.php index 2d0c2a3e1233..65baa097a832 100644 --- a/tests/system/Database/Builder/WhereTest.php +++ b/tests/system/Database/Builder/WhereTest.php @@ -30,11 +30,6 @@ #[Group('Others')] final class WhereTest extends CIUnitTestCase { - /** - * @var MockConnection - */ - protected $db; - protected function setUp(): void { parent::setUp(); @@ -407,6 +402,9 @@ public function testWhereInvalidKeyThrowInvalidArgumentException($key): void $builder->whereIn($key, ['Politician', 'Accountant']); } + /** + * @return iterable + */ public static function provideWhereInvalidKeyThrowInvalidArgumentException(): iterable { return [ @@ -427,6 +425,9 @@ public function testWhereInEmptyValuesThrowInvalidArgumentException($values): vo $builder->whereIn('name', $values); } + /** + * @return iterable + */ public static function provideWhereInEmptyValuesThrowInvalidArgumentException(): iterable { return [ diff --git a/tests/system/Database/Live/SQLite3/GetIndexDataTest.php b/tests/system/Database/Live/SQLite3/GetIndexDataTest.php index 5ef439644417..ac5bd5a299d8 100644 --- a/tests/system/Database/Live/SQLite3/GetIndexDataTest.php +++ b/tests/system/Database/Live/SQLite3/GetIndexDataTest.php @@ -13,7 +13,6 @@ namespace CodeIgniter\Database\Live\SQLite3; -use CodeIgniter\Database\SQLite3\Connection; use CodeIgniter\Database\SQLite3\Forge; use CodeIgniter\Test\CIUnitTestCase; use Config\Database; @@ -26,11 +25,6 @@ #[Group('DatabaseLive')] final class GetIndexDataTest extends CIUnitTestCase { - /** - * @var Connection - */ - protected $db; - private Forge $forge; protected function setUp(): void diff --git a/utils/phpstan-baseline/argument.type.neon b/utils/phpstan-baseline/argument.type.neon index b24fbeb6d8b7..4d117cc62429 100644 --- a/utils/phpstan-baseline/argument.type.neon +++ b/utils/phpstan-baseline/argument.type.neon @@ -1,27 +1,7 @@ -# total 54 errors +# total 33 errors parameters: ignoreErrors: - - - message: '#^Parameter \#3 \.\.\.\$arrays of function array_map expects array, int\|string given\.$#' - count: 1 - path: ../../system/Database/BaseBuilder.php - - - - message: '#^Parameter \#3 \.\.\.\$arrays of function array_map expects array, int\|string given\.$#' - count: 1 - path: ../../system/Database/OCI8/Builder.php - - - - message: '#^Parameter \#3 \.\.\.\$arrays of function array_map expects array, int\|string given\.$#' - count: 1 - path: ../../system/Database/Postgre/Builder.php - - - - message: '#^Parameter \#3 \.\.\.\$arrays of function array_map expects array, int\|string given\.$#' - count: 1 - 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\\ResponseInterface given\.$#' count: 1 @@ -52,21 +32,6 @@ parameters: count: 2 path: ../../tests/system/Config/FactoriesTest.php - - - message: '#^Parameter \#1 \$from of method CodeIgniter\\Database\\BaseBuilder\\:\:from\(\) expects array\|string, null given\.$#' - count: 1 - path: ../../tests/system/Database/Builder/FromTest.php - - - - message: '#^Parameter \#3 \$subject of function str_replace expects array\\|string, CodeIgniter\\Database\\ResultInterface given\.$#' - count: 10 - path: ../../tests/system/Database/Builder/GetTest.php - - - - message: '#^Parameter \#3 \$subject of function str_replace expects array\\|string, CodeIgniter\\Database\\ResultInterface\|false given\.$#' - count: 6 - path: ../../tests/system/Database/Builder/GetTest.php - - message: '#^Parameter \#1 \$fields of method CodeIgniter\\Database\\Forge\\:\:addField\(\) expects array\\|string, array\ given\.$#' count: 2 @@ -127,6 +92,16 @@ parameters: count: 1 path: ../../tests/system/Test/FeatureTestTraitTest.php + - + message: '#^Parameter \#1 \$body of method CodeIgniter\\HTTP\\Response\:\:setJSON\(\) expects array\\|object\|string, false given\.$#' + count: 1 + path: ../../tests/system/Test/TestResponseTest.php + + - + message: '#^Parameter \#1 \$body of method CodeIgniter\\HTTP\\Response\:\:setJSON\(\) expects array\\|object\|string, true given\.$#' + count: 1 + path: ../../tests/system/Test/TestResponseTest.php + - message: '#^Parameter \#2 \$context of method CodeIgniter\\View\\Parser\:\:setData\(\) expects ''attr''\|''css''\|''html''\|''js''\|''raw''\|''url''\|null, ''unknown'' given\.$#' count: 3 @@ -151,13 +126,3 @@ parameters: message: '#^Parameter \#2 \$resultID of class CodeIgniter\\View\\DBResultDummy constructor expects mysqli_result, null given\.$#' count: 2 path: ../../tests/system/View/TableTest.php - - - - message: '#^Parameter \#1 \$body of method CodeIgniter\\HTTP\\Response\:\:setJSON\(\) expects array\\|object\|string, false given\.$#' - count: 1 - path: ../../tests/system/Test/TestResponseTest.php - - - - message: '#^Parameter \#1 \$body of method CodeIgniter\\HTTP\\Response\:\:setJSON\(\) expects array\\|object\|string, true given\.$#' - count: 1 - path: ../../tests/system/Test/TestResponseTest.php diff --git a/utils/phpstan-baseline/assign.propertyType.neon b/utils/phpstan-baseline/assign.propertyType.neon index e782ea998087..3fb69d14d267 100644 --- a/utils/phpstan-baseline/assign.propertyType.neon +++ b/utils/phpstan-baseline/assign.propertyType.neon @@ -1,4 +1,4 @@ -# total 26 errors +# total 24 errors parameters: ignoreErrors: @@ -22,11 +22,6 @@ parameters: count: 1 path: ../../tests/system/Database/Live/SQLite3/AlterTableTest.php - - - message: '#^Property CodeIgniter\\Database\\Live\\SQLite3\\GetIndexDataTest\:\:\$db \(CodeIgniter\\Database\\SQLite3\\Connection\) does not accept CodeIgniter\\Database\\BaseConnection\.$#' - count: 2 - path: ../../tests/system/Database/Live/SQLite3/GetIndexDataTest.php - - message: '#^Property CodeIgniter\\Database\\Live\\SQLite3\\GetIndexDataTest\:\:\$forge \(CodeIgniter\\Database\\SQLite3\\Forge\) does not accept CodeIgniter\\Database\\Forge\.$#' count: 1 diff --git a/utils/phpstan-baseline/loader.neon b/utils/phpstan-baseline/loader.neon index afe95d3ef7fb..5c9064dc52fe 100644 --- a/utils/phpstan-baseline/loader.neon +++ b/utils/phpstan-baseline/loader.neon @@ -1,4 +1,4 @@ -# total 895 errors +# total 789 errors includes: - argument.type.neon diff --git a/utils/phpstan-baseline/method.childReturnType.neon b/utils/phpstan-baseline/method.childReturnType.neon index 1be112b559f7..6e6a320a6177 100644 --- a/utils/phpstan-baseline/method.childReturnType.neon +++ b/utils/phpstan-baseline/method.childReturnType.neon @@ -3,11 +3,11 @@ parameters: ignoreErrors: - - message: '#^Return type \(CodeIgniter\\HTTP\\URI\|null\) of method CodeIgniter\\HTTP\\OutgoingRequest\:\:getUri\(\) should be covariant with return type \(CodeIgniter\\HTTP\\URI\) of method CodeIgniter\\HTTP\\OutgoingRequestInterface\:\:getUri\(\)$#' + message: '#^Return type \(bool\) of method CodeIgniter\\HTTP\\Files\\UploadedFile\:\:move\(\) should be compatible with return type \(CodeIgniter\\Files\\File\) of method CodeIgniter\\Files\\File\:\:move\(\)$#' count: 1 - path: ../../system/HTTP/OutgoingRequest.php + path: ../../system/HTTP/Files/UploadedFile.php - - message: '#^Return type \(bool\) of method CodeIgniter\\HTTP\\Files\\UploadedFile\:\:move\(\) should be compatible with return type \(CodeIgniter\\Files\\File\) of method CodeIgniter\\Files\\File\:\:move\(\)$#' + message: '#^Return type \(CodeIgniter\\HTTP\\URI\|null\) of method CodeIgniter\\HTTP\\OutgoingRequest\:\:getUri\(\) should be covariant with return type \(CodeIgniter\\HTTP\\URI\) of method CodeIgniter\\HTTP\\OutgoingRequestInterface\:\:getUri\(\)$#' count: 1 - path: ../../system/HTTP/Files/UploadedFile.php + path: ../../system/HTTP/OutgoingRequest.php diff --git a/utils/phpstan-baseline/method.notFound.neon b/utils/phpstan-baseline/method.notFound.neon index f201cc43dad7..432b04269975 100644 --- a/utils/phpstan-baseline/method.notFound.neon +++ b/utils/phpstan-baseline/method.notFound.neon @@ -72,6 +72,11 @@ parameters: count: 1 path: ../../tests/system/RESTful/ResourceControllerTest.php + - + message: '#^Call to an undefined method CodeIgniter\\Test\\TestResponse\:\:ohno\(\)\.$#' + count: 1 + path: ../../tests/system/Test/ControllerTestTraitTest.php + - message: '#^Call to an undefined method CodeIgniter\\View\\Table\:\:compileTemplate\(\)\.$#' count: 2 @@ -96,8 +101,3 @@ parameters: message: '#^Call to an undefined method CodeIgniter\\View\\Table\:\:setFromDBResult\(\)\.$#' count: 1 path: ../../tests/system/View/TableTest.php - - - - message: '#^Call to an undefined method CodeIgniter\\Test\\TestResponse\:\:ohno\(\)\.$#' - count: 1 - path: ../../tests/system/Test/ControllerTestTraitTest.php diff --git a/utils/phpstan-baseline/missingType.iterableValue.neon b/utils/phpstan-baseline/missingType.iterableValue.neon index 4c57cf7f24d2..aabd40269d62 100644 --- a/utils/phpstan-baseline/missingType.iterableValue.neon +++ b/utils/phpstan-baseline/missingType.iterableValue.neon @@ -1,4 +1,4 @@ -# total 660 errors +# total 581 errors parameters: ignoreErrors: @@ -317,341 +317,6 @@ parameters: count: 1 path: ../../system/DataConverter/DataConverter.php - - - message: '#^Method CodeIgniter\\Database\\BaseBuilder\:\:__construct\(\) has parameter \$options with no value type specified in iterable type array\.$#' - count: 1 - path: ../../system/Database/BaseBuilder.php - - - - message: '#^Method CodeIgniter\\Database\\BaseBuilder\:\:__construct\(\) has parameter \$tableName 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 - path: ../../system/Database/BaseBuilder.php - - - - message: '#^Method CodeIgniter\\Database\\BaseBuilder\:\:batchObjectToArray\(\) return type has 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\.$#' - 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\.$#' - count: 1 - path: ../../system/Database/BaseBuilder.php - - - - message: '#^Method CodeIgniter\\Database\\BaseBuilder\:\:fieldsFromQuery\(\) return type has no value type specified in iterable type array\.$#' - count: 1 - path: ../../system/Database/BaseBuilder.php - - - - message: '#^Method CodeIgniter\\Database\\BaseBuilder\:\:formatValues\(\) has parameter \$values with no value type specified in iterable type array\.$#' - count: 1 - path: ../../system/Database/BaseBuilder.php - - - - message: '#^Method CodeIgniter\\Database\\BaseBuilder\:\:formatValues\(\) return type has no value type specified in iterable type array\.$#' - count: 1 - path: ../../system/Database/BaseBuilder.php - - - - message: '#^Method CodeIgniter\\Database\\BaseBuilder\:\:from\(\) has parameter \$from with no value type specified in iterable type array\.$#' - count: 1 - path: ../../system/Database/BaseBuilder.php - - - - message: '#^Method CodeIgniter\\Database\\BaseBuilder\:\:getBinds\(\) return type has no value type specified in iterable type array\.$#' - count: 1 - path: ../../system/Database/BaseBuilder.php - - - - message: '#^Method CodeIgniter\\Database\\BaseBuilder\:\:getCompiledQBWhere\(\) return type has no value type specified in iterable type array\.$#' - count: 1 - path: ../../system/Database/BaseBuilder.php - - - - message: '#^Method CodeIgniter\\Database\\BaseBuilder\:\:getOperator\(\) return type has no value type specified in iterable type array\.$#' - count: 1 - path: ../../system/Database/BaseBuilder.php - - - - message: '#^Method CodeIgniter\\Database\\BaseBuilder\:\:getSetData\(\) return type has no value type specified in iterable type array\.$#' - count: 1 - path: ../../system/Database/BaseBuilder.php - - - - message: '#^Method CodeIgniter\\Database\\BaseBuilder\:\:getWhere\(\) has parameter \$where with no value type specified in iterable type array\.$#' - count: 1 - path: ../../system/Database/BaseBuilder.php - - - - message: '#^Method CodeIgniter\\Database\\BaseBuilder\:\:groupBy\(\) has parameter \$by 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 - path: ../../system/Database/BaseBuilder.php - - - - message: '#^Method CodeIgniter\\Database\\BaseBuilder\:\:havingLike\(\) has parameter \$field with no value type specified in iterable type array\.$#' - count: 1 - path: ../../system/Database/BaseBuilder.php - - - - message: '#^Method CodeIgniter\\Database\\BaseBuilder\:\:havingNotIn\(\) has parameter \$values with no value type specified in iterable type array\.$#' - 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\:\:insertBatch\(\) has parameter \$set with no value type specified in iterable type array\.$#' - 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 - path: ../../system/Database/BaseBuilder.php - - - - message: '#^Method CodeIgniter\\Database\\BaseBuilder\:\:notHavingLike\(\) has parameter \$field with no value type specified in iterable type array\.$#' - count: 1 - path: ../../system/Database/BaseBuilder.php - - - - message: '#^Method CodeIgniter\\Database\\BaseBuilder\:\:notLike\(\) has parameter \$field with no value type specified in iterable type array\.$#' - count: 1 - path: ../../system/Database/BaseBuilder.php - - - - message: '#^Method CodeIgniter\\Database\\BaseBuilder\:\:objectToArray\(\) has parameter \$object with no value type specified in iterable type array\.$#' - count: 1 - path: ../../system/Database/BaseBuilder.php - - - - message: '#^Method CodeIgniter\\Database\\BaseBuilder\:\:objectToArray\(\) return type has no value type specified in iterable type array\.$#' - count: 1 - path: ../../system/Database/BaseBuilder.php - - - - message: '#^Method CodeIgniter\\Database\\BaseBuilder\:\:onConstraint\(\) has parameter \$set 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 - path: ../../system/Database/BaseBuilder.php - - - - message: '#^Method CodeIgniter\\Database\\BaseBuilder\:\:orHavingLike\(\) has parameter \$field with no value type specified in iterable type array\.$#' - count: 1 - path: ../../system/Database/BaseBuilder.php - - - - message: '#^Method CodeIgniter\\Database\\BaseBuilder\:\:orHavingNotIn\(\) has parameter \$values with no value type specified in iterable type array\.$#' - 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\:\: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\:\: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\:\:orNotLike\(\) has parameter \$field with no value type specified in iterable type array\.$#' - count: 1 - path: ../../system/Database/BaseBuilder.php - - - - message: '#^Method CodeIgniter\\Database\\BaseBuilder\:\:orWhereIn\(\) has parameter \$values with no value type specified in iterable type array\.$#' - count: 1 - path: ../../system/Database/BaseBuilder.php - - - - message: '#^Method CodeIgniter\\Database\\BaseBuilder\:\:orWhereNotIn\(\) has parameter \$values 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\.$#' - count: 1 - path: ../../system/Database/BaseBuilder.php - - - - 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\:\:resetRun\(\) has parameter \$qbResetItems with no value type specified in iterable type array\.$#' - count: 1 - path: ../../system/Database/BaseBuilder.php - - - - message: '#^Method CodeIgniter\\Database\\BaseBuilder\:\:setData\(\) has parameter \$set with no value type specified in iterable type array\.$#' - count: 1 - path: ../../system/Database/BaseBuilder.php - - - - message: '#^Method CodeIgniter\\Database\\BaseBuilder\:\:setQueryAsData\(\) has parameter \$columns with no value type specified in iterable type array\.$#' - count: 1 - path: ../../system/Database/BaseBuilder.php - - - - message: '#^Method CodeIgniter\\Database\\BaseBuilder\:\:setUpdateBatch\(\) has parameter \$key 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\.$#' - count: 1 - path: ../../system/Database/BaseBuilder.php - - - - 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\:\: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 \$set 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\.$#' - 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\.$#' - 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\.$#' - count: 1 - path: ../../system/Database/BaseBuilder.php - - - - message: '#^Method CodeIgniter\\Database\\BaseBuilder\:\:upsertBatch\(\) 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\.$#' - count: 1 - path: ../../system/Database/BaseBuilder.php - - - - message: '#^Method CodeIgniter\\Database\\BaseBuilder\:\:whereHaving\(\) has parameter \$key with no value type specified in iterable type array\.$#' - 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\:\:whereNotIn\(\) has parameter \$values with no value type specified in iterable type array\.$#' - 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 - path: ../../system/Database/BaseBuilder.php - - - - message: '#^Property CodeIgniter\\Database\\BaseBuilder\:\:\$QBGroupBy type has no value type specified in iterable type array\.$#' - count: 1 - path: ../../system/Database/BaseBuilder.php - - - - message: '#^Property CodeIgniter\\Database\\BaseBuilder\:\:\$QBHaving type has no value type specified in iterable type array\.$#' - count: 1 - path: ../../system/Database/BaseBuilder.php - - - - message: '#^Property CodeIgniter\\Database\\BaseBuilder\:\:\$QBJoin type has no value type specified in iterable type array\.$#' - count: 1 - path: ../../system/Database/BaseBuilder.php - - - - message: '#^Property CodeIgniter\\Database\\BaseBuilder\:\:\$QBOptions type has no value type specified in iterable type array\.$#' - count: 3 - path: ../../system/Database/BaseBuilder.php - - - - message: '#^Property CodeIgniter\\Database\\BaseBuilder\:\:\$QBOrderBy type has no value type specified in iterable type array\.$#' - count: 1 - path: ../../system/Database/BaseBuilder.php - - - - message: '#^Property CodeIgniter\\Database\\BaseBuilder\:\:\$QBWhere type has no value type specified in iterable type array\.$#' - count: 1 - path: ../../system/Database/BaseBuilder.php - - - - message: '#^Property CodeIgniter\\Database\\BaseBuilder\:\:\$binds type has no value type specified in iterable type array\.$#' - count: 1 - path: ../../system/Database/BaseBuilder.php - - - - message: '#^Property CodeIgniter\\Database\\BaseBuilder\:\:\$bindsKeyCount type has no value type specified in iterable type array\.$#' - count: 1 - path: ../../system/Database/BaseBuilder.php - - - - message: '#^Property CodeIgniter\\Database\\BaseBuilder\:\:\$joinTypes type has no value type specified in iterable type array\.$#' - count: 1 - path: ../../system/Database/BaseBuilder.php - - - - message: '#^Property CodeIgniter\\Database\\BaseBuilder\:\:\$randomKeyword type has no value type specified in iterable type array\.$#' - count: 1 - path: ../../system/Database/BaseBuilder.php - - message: '#^Class CodeIgniter\\Database\\BaseConnection has PHPDoc tag @property\-read for property \$aliasedTables with no value type specified in iterable type array\.$#' count: 1 @@ -1182,16 +847,6 @@ parameters: count: 1 path: ../../system/Database/MySQLi/Utils.php - - - message: '#^Method CodeIgniter\\Database\\OCI8\\Builder\:\:fieldsFromQuery\(\) return type has no value type specified in iterable type array\.$#' - count: 1 - path: ../../system/Database/OCI8/Builder.php - - - - message: '#^Property CodeIgniter\\Database\\OCI8\\Builder\:\:\$randomKeyword type has no value type specified in iterable type array\.$#' - count: 1 - path: ../../system/Database/OCI8/Builder.php - - message: '#^Method CodeIgniter\\Database\\OCI8\\Connection\:\:bindParams\(\) has parameter \$params with no value type specified in iterable type array\.$#' count: 1 @@ -1272,16 +927,6 @@ parameters: count: 1 path: ../../system/Database/OCI8/Utils.php - - - message: '#^Method CodeIgniter\\Database\\Postgre\\Builder\:\:replace\(\) has parameter \$set with no value type specified in iterable type array\.$#' - count: 1 - path: ../../system/Database/Postgre/Builder.php - - - - message: '#^Property CodeIgniter\\Database\\Postgre\\Builder\:\:\$randomKeyword type has no value type specified in iterable type array\.$#' - count: 1 - path: ../../system/Database/Postgre/Builder.php - - message: '#^Method CodeIgniter\\Database\\Postgre\\Connection\:\:escape\(\) return type has no value type specified in iterable type array\.$#' count: 1 @@ -1452,21 +1097,6 @@ parameters: count: 1 path: ../../system/Database/ResultInterface.php - - - message: '#^Method CodeIgniter\\Database\\SQLSRV\\Builder\:\:fieldsFromQuery\(\) return type has no value type specified in iterable type array\.$#' - count: 1 - path: ../../system/Database/SQLSRV/Builder.php - - - - message: '#^Method CodeIgniter\\Database\\SQLSRV\\Builder\:\:replace\(\) has parameter \$set with no value type specified in iterable type array\.$#' - count: 1 - path: ../../system/Database/SQLSRV/Builder.php - - - - message: '#^Property CodeIgniter\\Database\\SQLSRV\\Builder\:\:\$randomKeyword type has no value type specified in iterable type array\.$#' - count: 1 - path: ../../system/Database/SQLSRV/Builder.php - - message: '#^Method CodeIgniter\\Database\\SQLSRV\\Connection\:\:__construct\(\) has parameter \$params with no value type specified in iterable type array\.$#' count: 1 @@ -1557,11 +1187,6 @@ parameters: count: 1 path: ../../system/Database/SQLSRV/Utils.php - - - message: '#^Property CodeIgniter\\Database\\SQLite3\\Builder\:\:\$randomKeyword type has no value type specified in iterable type array\.$#' - count: 1 - path: ../../system/Database/SQLite3/Builder.php - - message: '#^Method CodeIgniter\\Database\\SQLite3\\Forge\:\:_alterTable\(\) has parameter \$processedFields with no value type specified in iterable type array\.$#' count: 1 @@ -2612,16 +2237,6 @@ parameters: count: 1 path: ../../tests/system/Database/BaseQueryTest.php - - - message: '#^Method CodeIgniter\\Database\\Builder\\WhereTest\:\:provideWhereInEmptyValuesThrowInvalidArgumentException\(\) return type has no value type specified in iterable type iterable\.$#' - count: 1 - path: ../../tests/system/Database/Builder/WhereTest.php - - - - message: '#^Method CodeIgniter\\Database\\Builder\\WhereTest\:\:provideWhereInvalidKeyThrowInvalidArgumentException\(\) return type has no value type specified in iterable type iterable\.$#' - count: 1 - path: ../../tests/system/Database/Builder/WhereTest.php - - message: '#^Method CodeIgniter\\Database\\ConfigTest\:\:provideConvertDSN\(\) return type has no value type specified in iterable type iterable\.$#' count: 1 @@ -3112,6 +2727,16 @@ parameters: count: 1 path: ../../tests/system/Test/ControllerTestTraitTest.php + - + message: '#^Method CodeIgniter\\Test\\DOMParserTest\:\:provideText\(\) return type has no value type specified in iterable type iterable\.$#' + count: 1 + path: ../../tests/system/Test/DOMParserTest.php + + - + message: '#^Property CodeIgniter\\Test\\FabricatorTest\:\:\$formatters type has no value type specified in iterable type array\.$#' + count: 1 + path: ../../tests/system/Test/FabricatorTest.php + - message: '#^Method CodeIgniter\\Test\\FeatureTestAutoRoutingImprovedTest\:\:call\(\) has parameter \$params with no value type specified in iterable type array\.$#' count: 1 @@ -3192,6 +2817,11 @@ parameters: count: 1 path: ../../tests/system/Test/FeatureTestTraitTest.php + - + message: '#^Method CodeIgniter\\Test\\FeatureTestTraitTest\:\:provideOpenCliRoutesFromHttpGot404\(\) return type has no value type specified in iterable type iterable\.$#' + count: 1 + path: ../../tests/system/Test/FeatureTestTraitTest.php + - message: '#^Method CodeIgniter\\Test\\FeatureTestTraitTest\:\:put\(\) has parameter \$params with no value type specified in iterable type array\.$#' count: 1 @@ -3212,6 +2842,26 @@ parameters: count: 1 path: ../../tests/system/Test/IniTestTraitTest.php + - + message: '#^Method CodeIgniter\\Test\\TestLoggerTest\:\:provideDidLogMethod\(\) return type has no value type specified in iterable type iterable\.$#' + count: 1 + path: ../../tests/system/Test/TestLoggerTest.php + + - + message: '#^Method CodeIgniter\\Test\\TestResponseTest\:\:getTestResponse\(\) has parameter \$headers with no value type specified in iterable type array\.$#' + count: 1 + path: ../../tests/system/Test/TestResponseTest.php + + - + message: '#^Method CodeIgniter\\Test\\TestResponseTest\:\:getTestResponse\(\) has parameter \$responseOptions with no value type specified in iterable type array\.$#' + count: 1 + path: ../../tests/system/Test/TestResponseTest.php + + - + message: '#^Method CodeIgniter\\Test\\TestResponseTest\:\:provideHttpStatusCodes\(\) return type has no value type specified in iterable type iterable\.$#' + count: 1 + path: ../../tests/system/Test/TestResponseTest.php + - message: '#^Method CodeIgniter\\Throttle\\ThrottleTest\:\:provideTokenTimeCalculationUCs\(\) return type has no value type specified in iterable type iterable\.$#' count: 1 @@ -3256,38 +2906,3 @@ parameters: message: '#^Method CodeIgniter\\View\\TableTest\:\:testGenerateOrderedColumns\(\) has parameter \$row with no value type specified in iterable type array\.$#' count: 1 path: ../../tests/system/View/TableTest.php - - - - message: '#^Method CodeIgniter\\Test\\DOMParserTest\:\:provideText\(\) return type has no value type specified in iterable type iterable\.$#' - count: 1 - path: ../../tests/system/Test/DOMParserTest.php - - - - message: '#^Method CodeIgniter\\Test\\FeatureTestTraitTest\:\:provideOpenCliRoutesFromHttpGot404\(\) return type has no value type specified in iterable type iterable\.$#' - count: 1 - path: ../../tests/system/Test/FeatureTestTraitTest.php - - - - message: '#^Method CodeIgniter\\Test\\TestLoggerTest\:\:provideDidLogMethod\(\) return type has no value type specified in iterable type iterable\.$#' - count: 1 - path: ../../tests/system/Test/TestLoggerTest.php - - - - message: '#^Method CodeIgniter\\Test\\TestResponseTest\:\:getTestResponse\(\) has parameter \$headers with no value type specified in iterable type array\.$#' - count: 1 - path: ../../tests/system/Test/TestResponseTest.php - - - - message: '#^Method CodeIgniter\\Test\\TestResponseTest\:\:getTestResponse\(\) has parameter \$responseOptions with no value type specified in iterable type array\.$#' - count: 1 - path: ../../tests/system/Test/TestResponseTest.php - - - - message: '#^Method CodeIgniter\\Test\\TestResponseTest\:\:provideHttpStatusCodes\(\) return type has no value type specified in iterable type iterable\.$#' - count: 1 - path: ../../tests/system/Test/TestResponseTest.php - - - - message: '#^Property CodeIgniter\\Test\\FabricatorTest\:\:\$formatters type has no value type specified in iterable type array\.$#' - count: 1 - path: ../../tests/system/Test/FabricatorTest.php diff --git a/utils/phpstan-baseline/property.phpDocType.neon b/utils/phpstan-baseline/property.phpDocType.neon index 745a740bd8dc..31a1387605af 100644 --- a/utils/phpstan-baseline/property.phpDocType.neon +++ b/utils/phpstan-baseline/property.phpDocType.neon @@ -1,4 +1,4 @@ -# total 36 errors +# total 32 errors parameters: ignoreErrors: @@ -123,39 +123,29 @@ parameters: path: ../../system/Exceptions/PageNotFoundException.php - - message: '#^PHPDoc type string of property CodeIgniter\\Session\\Handlers\\FileHandler\:\:\$savePath is not the same as PHPDoc type array\\|string of overridden property CodeIgniter\\Session\\Handlers\\BaseHandler\:\:\$savePath\.$#' - count: 1 - path: ../../system/Session/Handlers/FileHandler.php - - - - message: '#^PHPDoc type CodeIgniter\\Test\\Mock\\MockConnection of property CodeIgniter\\Database\\Builder\\InsertTest\:\:\$db is not the same as PHPDoc type CodeIgniter\\Database\\BaseConnection of overridden property CodeIgniter\\Test\\CIUnitTestCase\:\:\$db\.$#' - count: 1 - path: ../../tests/system/Database/Builder/InsertTest.php - - - - message: '#^PHPDoc type CodeIgniter\\Test\\Mock\\MockConnection of property CodeIgniter\\Database\\Builder\\UnionTest\:\:\$db is not the same as PHPDoc type CodeIgniter\\Database\\BaseConnection of overridden property CodeIgniter\\Test\\CIUnitTestCase\:\:\$db\.$#' + message: '#^PHPDoc type int of property CodeIgniter\\HTTP\\Exceptions\\RedirectException\:\:\$code is not the same as PHPDoc type mixed of overridden property Exception\:\:\$code\.$#' count: 1 - path: ../../tests/system/Database/Builder/UnionTest.php + path: ../../system/HTTP/Exceptions/RedirectException.php - - message: '#^PHPDoc type CodeIgniter\\Test\\Mock\\MockConnection of property CodeIgniter\\Database\\Builder\\UpdateTest\:\:\$db is not the same as PHPDoc type CodeIgniter\\Database\\BaseConnection of overridden property CodeIgniter\\Test\\CIUnitTestCase\:\:\$db\.$#' + message: '#^PHPDoc type CodeIgniter\\HTTP\\URI of property CodeIgniter\\HTTP\\IncomingRequest\:\:\$uri is not the same as PHPDoc type CodeIgniter\\HTTP\\URI\|null of overridden property CodeIgniter\\HTTP\\OutgoingRequest\:\:\$uri\.$#' count: 1 - path: ../../tests/system/Database/Builder/UpdateTest.php + path: ../../system/HTTP/IncomingRequest.php - - message: '#^PHPDoc type CodeIgniter\\Test\\Mock\\MockConnection of property CodeIgniter\\Database\\Builder\\WhenTest\:\:\$db is not the same as PHPDoc type CodeIgniter\\Database\\BaseConnection of overridden property CodeIgniter\\Test\\CIUnitTestCase\:\:\$db\.$#' + message: '#^PHPDoc type string of property CodeIgniter\\Session\\Handlers\\FileHandler\:\:\$savePath is not the same as PHPDoc type array\\|string of overridden property CodeIgniter\\Session\\Handlers\\BaseHandler\:\:\$savePath\.$#' count: 1 - path: ../../tests/system/Database/Builder/WhenTest.php + path: ../../system/Session/Handlers/FileHandler.php - - message: '#^PHPDoc type CodeIgniter\\Test\\Mock\\MockConnection of property CodeIgniter\\Database\\Builder\\WhereTest\:\:\$db is not the same as PHPDoc type CodeIgniter\\Database\\BaseConnection of overridden property CodeIgniter\\Test\\CIUnitTestCase\:\:\$db\.$#' + message: '#^PHPDoc type CodeIgniter\\Test\\Mock\\MockConnection of property CodeIgniter\\Database\\Builder\\InsertTest\:\:\$db is not the same as PHPDoc type CodeIgniter\\Database\\BaseConnection of overridden property CodeIgniter\\Test\\CIUnitTestCase\:\:\$db\.$#' count: 1 - path: ../../tests/system/Database/Builder/WhereTest.php + path: ../../tests/system/Database/Builder/InsertTest.php - - message: '#^PHPDoc type CodeIgniter\\Database\\SQLite3\\Connection of property CodeIgniter\\Database\\Live\\SQLite3\\GetIndexDataTest\:\:\$db is not the same as PHPDoc type CodeIgniter\\Database\\BaseConnection of overridden property CodeIgniter\\Test\\CIUnitTestCase\:\:\$db\.$#' + message: '#^PHPDoc type CodeIgniter\\Test\\Mock\\MockConnection of property CodeIgniter\\Database\\Builder\\UpdateTest\:\:\$db is not the same as PHPDoc type CodeIgniter\\Database\\BaseConnection of overridden property CodeIgniter\\Test\\CIUnitTestCase\:\:\$db\.$#' count: 1 - path: ../../tests/system/Database/Live/SQLite3/GetIndexDataTest.php + path: ../../tests/system/Database/Builder/UpdateTest.php - message: '#^PHPDoc type Tests\\Support\\Models\\EventModel of property CodeIgniter\\Models\\EventsModelTest\:\:\$model is not the same as PHPDoc type CodeIgniter\\Model of overridden property CodeIgniter\\Models\\LiveModelTestCase\:\:\$model\.$#' @@ -171,13 +161,3 @@ parameters: message: '#^PHPDoc type CodeIgniter\\Router\\RouteCollection of property CodeIgniter\\RESTful\\ResourcePresenterTest\:\:\$routes is not the same as PHPDoc type CodeIgniter\\Router\\RouteCollection\|null of overridden property CodeIgniter\\Test\\CIUnitTestCase\:\:\$routes\.$#' count: 1 path: ../../tests/system/RESTful/ResourcePresenterTest.php - - - - message: '#^PHPDoc type CodeIgniter\\HTTP\\URI of property CodeIgniter\\HTTP\\IncomingRequest\:\:\$uri is not the same as PHPDoc type CodeIgniter\\HTTP\\URI\|null of overridden property CodeIgniter\\HTTP\\OutgoingRequest\:\:\$uri\.$#' - count: 1 - path: ../../system/HTTP/IncomingRequest.php - - - - message: '#^PHPDoc type int of property CodeIgniter\\HTTP\\Exceptions\\RedirectException\:\:\$code is not the same as PHPDoc type mixed of overridden property Exception\:\:\$code\.$#' - count: 1 - path: ../../system/HTTP/Exceptions/RedirectException.php