From 1943290fa0ca0dc906d258f769a83ed9e261d5fd Mon Sep 17 00:00:00 2001 From: "John Paul E. Balandan, CPA" Date: Sun, 23 Aug 2026 22:22:01 +0800 Subject: [PATCH] refactor: fix phpstan errors in `PreparedQuery` and `Utils` --- system/Database/BasePreparedQuery.php | 35 +---- system/Database/BaseUtils.php | 20 +-- system/Database/MySQLi/PreparedQuery.php | 19 --- system/Database/MySQLi/Utils.php | 12 +- system/Database/OCI8/PreparedQuery.php | 19 --- system/Database/OCI8/Utils.php | 8 +- system/Database/Postgre/PreparedQuery.php | 18 --- system/Database/Postgre/Utils.php | 12 +- system/Database/PreparedQueryInterface.php | 6 +- system/Database/SQLSRV/PreparedQuery.php | 25 +--- system/Database/SQLSRV/Utils.php | 12 +- system/Database/SQLite3/PreparedQuery.php | 19 --- system/Database/SQLite3/Utils.php | 8 +- utils/phpstan-baseline/loader.neon | 2 +- .../missingType.iterableValue.neon | 127 +----------------- .../missingType.parameter.neon | 12 +- .../phpstan-baseline/property.phpDocType.neon | 42 +----- 17 files changed, 45 insertions(+), 351 deletions(-) diff --git a/system/Database/BasePreparedQuery.php b/system/Database/BasePreparedQuery.php index e770a8d35f11..723b6b8f12e6 100644 --- a/system/Database/BasePreparedQuery.php +++ b/system/Database/BasePreparedQuery.php @@ -70,15 +70,6 @@ public function __construct(BaseConnection $db) $this->db = $db; } - /** - * Prepares the query against the database, and saves the connection - * info necessary to execute the query later. - * - * NOTE: This version is based on SQL code. Child classes should - * override this method. - * - * @return $this - */ public function prepare(string $sql, array $options = [], string $queryClass = Query::class) { // We only support positional placeholders (?), so convert @@ -101,18 +92,13 @@ public function prepare(string $sql, array $options = [], string $queryClass = Q } /** - * The database-dependent portion of the prepare statement. + * @param array $options Passed to the connection's prepare statement. Only the SQLSRV driver uses it. * * @return $this */ abstract public function _prepare(string $sql, array $options = []); /** - * Takes a new set of data and runs it against the currently - * prepared query. Upon success, will return a Results object. - * - * @return bool|ResultInterface - * * @throws DatabaseException */ public function execute(...$data) @@ -186,7 +172,7 @@ public function execute(...$data) } /** - * The database dependant version of the execute method. + * @param list $data */ abstract public function _execute(array $data): bool; @@ -197,11 +183,6 @@ abstract public function _execute(array $data): bool; */ abstract public function _getResult(); - /** - * Explicitly closes the prepared statement. - * - * @throws BadMethodCallException - */ public function close(): bool { if (! isset($this->statement)) { @@ -215,14 +196,8 @@ public function close(): bool } } - /** - * The database-dependent version of the close method. - */ abstract protected function _close(): bool; - /** - * Returns the SQL that has been prepared. - */ public function getQueryString(): string { if (! $this->query instanceof QueryInterface) { @@ -240,17 +215,11 @@ public function hasError(): bool return $this->errorString !== ''; } - /** - * Returns the error code created while executing this statement. - */ public function getErrorCode(): int { return $this->errorCode; } - /** - * Returns the error message created while executing this statement. - */ public function getErrorMessage(): string { return $this->errorString; diff --git a/system/Database/BaseUtils.php b/system/Database/BaseUtils.php index ddea4301c556..cf42bb7f7184 100644 --- a/system/Database/BaseUtils.php +++ b/system/Database/BaseUtils.php @@ -16,14 +16,12 @@ use CodeIgniter\Database\Exceptions\DatabaseException; /** - * Class BaseUtils + * @template TDb of BaseConnection */ abstract class BaseUtils { /** - * Database object - * - * @var object + * @var TDb */ protected $db; @@ -49,7 +47,7 @@ abstract class BaseUtils protected $repairTable = false; /** - * Class constructor + * @param TDb $db */ public function __construct(ConnectionInterface $db) { @@ -59,7 +57,7 @@ public function __construct(ConnectionInterface $db) /** * List databases * - * @return array|bool + * @return bool|list * * @throws DatabaseException */ @@ -229,6 +227,8 @@ public function getCSVFromResult(ResultInterface $query, string $delim = ',', st /** * Generate XML data from a query result object + * + * @param array $params */ public function getXMLFromResult(ResultInterface $query, array $params = []): string { @@ -264,9 +264,9 @@ public function getXMLFromResult(ResultInterface $query, array $params = []): st /** * Database Backup * - * @param array|string $params + * @param array|string $params * - * @return false|never|string + * @return false|string * * @throws DatabaseException */ @@ -320,9 +320,9 @@ public function backup($params = []) } /** - * Platform dependent version of the backup function. + * @param array|null $prefs * - * @return false|never|string + * @return false|string */ abstract public function _backup(?array $prefs = null); } diff --git a/system/Database/MySQLi/PreparedQuery.php b/system/Database/MySQLi/PreparedQuery.php index d018250bfc48..4f40a358386c 100644 --- a/system/Database/MySQLi/PreparedQuery.php +++ b/system/Database/MySQLi/PreparedQuery.php @@ -28,16 +28,6 @@ */ class PreparedQuery extends BasePreparedQuery { - /** - * Prepares the query against the database, and saves the connection - * info necessary to execute the query later. - * - * NOTE: This version is based on SQL code. Child classes should - * override this method. - * - * @param array $options Passed to the connection's prepare statement. - * Unused in the MySQLi driver. - */ public function _prepare(string $sql, array $options = []): PreparedQuery { // Mysqli driver doesn't like statements @@ -56,10 +46,6 @@ public function _prepare(string $sql, array $options = []): PreparedQuery return $this; } - /** - * Takes a new set of data and runs it against the currently - * prepared query. Upon success, will return a Results object. - */ public function _execute(array $data): bool { if (! isset($this->statement)) { @@ -104,8 +90,6 @@ public function _execute(array $data): bool } /** - * Returns the result object for the prepared query or false on failure. - * * @return false|mysqli_result */ public function _getResult() @@ -113,9 +97,6 @@ public function _getResult() return $this->statement->get_result(); } - /** - * Deallocate prepared statements. - */ protected function _close(): bool { return $this->statement->close(); diff --git a/system/Database/MySQLi/Utils.php b/system/Database/MySQLi/Utils.php index be68367361fd..16f0d0f98ec7 100644 --- a/system/Database/MySQLi/Utils.php +++ b/system/Database/MySQLi/Utils.php @@ -18,26 +18,22 @@ /** * Utils for MySQLi + * + * @extends BaseUtils */ class Utils extends BaseUtils { /** - * List databases statement - * - * @var string + * @var bool|string */ protected $listDatabases = 'SHOW DATABASES'; /** - * OPTIMIZE TABLE statement - * - * @var string + * @var bool|string */ protected $optimizeTable = 'OPTIMIZE TABLE %s'; /** - * Platform dependent version of the backup function. - * * @return never */ public function _backup(?array $prefs = null) diff --git a/system/Database/OCI8/PreparedQuery.php b/system/Database/OCI8/PreparedQuery.php index bd027bcb1bc3..38c24ff26b99 100644 --- a/system/Database/OCI8/PreparedQuery.php +++ b/system/Database/OCI8/PreparedQuery.php @@ -30,16 +30,6 @@ class PreparedQuery extends BasePreparedQuery */ private ?string $lastInsertTableName = null; - /** - * Prepares the query against the database, and saves the connection - * info necessary to execute the query later. - * - * NOTE: This version is based on SQL code. Child classes should - * override this method. - * - * @param array $options Passed to the connection's prepare statement. - * Unused in the OCI8 driver. - */ public function _prepare(string $sql, array $options = []): PreparedQuery { if (! $this->statement = oci_parse($this->db->connID, $this->parameterize($sql))) { @@ -57,10 +47,6 @@ public function _prepare(string $sql, array $options = []): PreparedQuery return $this; } - /** - * Takes a new set of data and runs it against the currently - * prepared query. Upon success, will return a Results object. - */ public function _execute(array $data): bool { if (! isset($this->statement)) { @@ -93,8 +79,6 @@ public function _execute(array $data): bool } /** - * Returns the statement resource for the prepared query or false when preparing failed. - * * @return resource|null */ public function _getResult() @@ -102,9 +86,6 @@ public function _getResult() return $this->statement; } - /** - * Deallocate prepared statements. - */ protected function _close(): bool { return oci_free_statement($this->statement); diff --git a/system/Database/OCI8/Utils.php b/system/Database/OCI8/Utils.php index c6e97963facf..4995446076fb 100644 --- a/system/Database/OCI8/Utils.php +++ b/system/Database/OCI8/Utils.php @@ -18,19 +18,17 @@ /** * Utils for OCI8 + * + * @extends BaseUtils */ class Utils extends BaseUtils { /** - * List databases statement - * - * @var string + * @var bool|string */ protected $listDatabases = 'SELECT TABLESPACE_NAME FROM USER_TABLESPACES'; /** - * Platform dependent version of the backup function. - * * @return never */ public function _backup(?array $prefs = null) diff --git a/system/Database/Postgre/PreparedQuery.php b/system/Database/Postgre/PreparedQuery.php index 646c55d91406..418259db7013 100644 --- a/system/Database/Postgre/PreparedQuery.php +++ b/system/Database/Postgre/PreparedQuery.php @@ -44,15 +44,6 @@ class PreparedQuery extends BasePreparedQuery protected $result; /** - * Prepares the query against the database, and saves the connection - * info necessary to execute the query later. - * - * NOTE: This version is based on SQL code. Child classes should - * override this method. - * - * @param array $options Passed to the connection's prepare statement. - * Unused in the MySQLi driver. - * * @throws Exception */ public function _prepare(string $sql, array $options = []): PreparedQuery @@ -77,10 +68,6 @@ public function _prepare(string $sql, array $options = []): PreparedQuery return $this; } - /** - * Takes a new set of data and runs it against the currently - * prepared query. Upon success, will return a Results object. - */ public function _execute(array $data): bool { if (! isset($this->statement)) { @@ -99,8 +86,6 @@ public function _execute(array $data): bool } /** - * Returns the result object for the prepared query or false on failure. - * * @return PgSqlResult|null */ public function _getResult() @@ -108,9 +93,6 @@ public function _getResult() return $this->result; } - /** - * Deallocate prepared statements. - */ protected function _close(): bool { return pg_query($this->db->connID, 'DEALLOCATE "' . $this->db->escapeIdentifiers($this->name) . '"') !== false; diff --git a/system/Database/Postgre/Utils.php b/system/Database/Postgre/Utils.php index c3b7b82d1681..ab2e3bd6d056 100644 --- a/system/Database/Postgre/Utils.php +++ b/system/Database/Postgre/Utils.php @@ -18,26 +18,22 @@ /** * Utils for Postgre + * + * @extends BaseUtils */ class Utils extends BaseUtils { /** - * List databases statement - * - * @var string + * @var bool|string */ protected $listDatabases = 'SELECT datname FROM pg_database'; /** - * OPTIMIZE TABLE statement - * - * @var string + * @var bool|string */ protected $optimizeTable = 'REINDEX TABLE %s'; /** - * Platform dependent version of the backup function. - * * @return never */ public function _backup(?array $prefs = null) diff --git a/system/Database/PreparedQueryInterface.php b/system/Database/PreparedQueryInterface.php index c49c2e7bb551..fa2c2a9aac28 100644 --- a/system/Database/PreparedQueryInterface.php +++ b/system/Database/PreparedQueryInterface.php @@ -26,6 +26,8 @@ interface PreparedQueryInterface * Takes a new set of data and runs it against the currently * prepared query. Upon success, will return a Results object. * + * @param mixed ...$data + * * @return bool|ResultInterface */ public function execute(...$data); @@ -34,12 +36,14 @@ public function execute(...$data); * Prepares the query against the database, and saves the connection * info necessary to execute the query later. * + * @param array $options + * * @return $this */ public function prepare(string $sql, array $options = []); /** - * Explicity closes the statement. + * Explicitly closes the statement. * * @throws BadMethodCallException */ diff --git a/system/Database/SQLSRV/PreparedQuery.php b/system/Database/SQLSRV/PreparedQuery.php index 0cdc842b1196..9e21eed19000 100644 --- a/system/Database/SQLSRV/PreparedQuery.php +++ b/system/Database/SQLSRV/PreparedQuery.php @@ -18,7 +18,7 @@ use CodeIgniter\Exceptions\BadMethodCallException; /** - * Prepared query for Postgre + * Prepared query for SQLSRV * * @extends BasePreparedQuery */ @@ -27,7 +27,7 @@ class PreparedQuery extends BasePreparedQuery /** * Parameters array used to store the dynamic variables. * - * @var array + * @var array */ protected $parameters = []; @@ -37,13 +37,7 @@ public function __construct(Connection $db) } /** - * Prepares the query against the database, and saves the connection - * info necessary to execute the query later. - * - * NOTE: This version is based on SQL code. Child classes should - * override this method. - * - * @param array $options Options takes an associative array; + * @param array $options Positional array of bind values, keyed by placeholder index. * * @throws DatabaseException */ @@ -70,10 +64,6 @@ public function _prepare(string $sql, array $options = []): PreparedQuery return $this; } - /** - * Takes a new set of data and runs it against the currently - * prepared query. - */ public function _execute(array $data): bool { if (! isset($this->statement)) { @@ -94,8 +84,6 @@ public function _execute(array $data): bool } /** - * Returns the statement resource for the prepared query or false when preparing failed. - * * @return resource|null */ public function _getResult() @@ -103,9 +91,6 @@ public function _getResult() return $this->statement; } - /** - * Deallocate prepared statements. - */ protected function _close(): bool { return sqlsrv_free_stmt($this->statement); @@ -114,7 +99,9 @@ protected function _close(): bool /** * Handle parameters. * - * @param array $options + * @param array $options + * + * @return list */ protected function parameterize(string $queryString, array $options): array { diff --git a/system/Database/SQLSRV/Utils.php b/system/Database/SQLSRV/Utils.php index f74ac39f7a88..1e7fe45730a2 100644 --- a/system/Database/SQLSRV/Utils.php +++ b/system/Database/SQLSRV/Utils.php @@ -19,20 +19,18 @@ /** * Utils for SQLSRV + * + * @extends BaseUtils */ class Utils extends BaseUtils { /** - * List databases statement - * - * @var string + * @var bool|string */ protected $listDatabases = 'EXEC sp_helpdb'; // Can also be: EXEC sp_databases /** - * OPTIMIZE TABLE statement - * - * @var string + * @var bool|string */ protected $optimizeTable = 'ALTER INDEX all ON %s REORGANIZE'; @@ -44,8 +42,6 @@ public function __construct(ConnectionInterface $db) } /** - * Platform dependent version of the backup function. - * * @return never */ public function _backup(?array $prefs = null) diff --git a/system/Database/SQLite3/PreparedQuery.php b/system/Database/SQLite3/PreparedQuery.php index 5a5153a5f7a3..1986961f648a 100644 --- a/system/Database/SQLite3/PreparedQuery.php +++ b/system/Database/SQLite3/PreparedQuery.php @@ -35,16 +35,6 @@ class PreparedQuery extends BasePreparedQuery */ protected $result; - /** - * Prepares the query against the database, and saves the connection - * info necessary to execute the query later. - * - * NOTE: This version is based on SQL code. Child classes should - * override this method. - * - * @param array $options Passed to the connection's prepare statement. - * Unused in the MySQLi driver. - */ public function _prepare(string $sql, array $options = []): PreparedQuery { if (! ($this->statement = $this->db->connID->prepare($sql))) { @@ -59,10 +49,6 @@ public function _prepare(string $sql, array $options = []): PreparedQuery return $this; } - /** - * Takes a new set of data and runs it against the currently - * prepared query. Upon success, will return a Results object. - */ public function _execute(array $data): bool { if (! isset($this->statement)) { @@ -99,8 +85,6 @@ public function _execute(array $data): bool } /** - * Returns the result object for the prepared query or false on failure. - * * @return false|SQLite3Result */ public function _getResult() @@ -108,9 +92,6 @@ public function _getResult() return $this->result; } - /** - * Deallocate prepared statements. - */ protected function _close(): bool { return $this->statement->close(); diff --git a/system/Database/SQLite3/Utils.php b/system/Database/SQLite3/Utils.php index 93f7f0e00db7..c2102e6accab 100644 --- a/system/Database/SQLite3/Utils.php +++ b/system/Database/SQLite3/Utils.php @@ -18,19 +18,17 @@ /** * Utils for SQLite3 + * + * @extends BaseUtils */ class Utils extends BaseUtils { /** - * OPTIMIZE TABLE statement - * - * @var string + * @var bool|string */ protected $optimizeTable = 'REINDEX %s'; /** - * Platform dependent version of the backup function. - * * @return never */ public function _backup(?array $prefs = null) diff --git a/utils/phpstan-baseline/loader.neon b/utils/phpstan-baseline/loader.neon index a6bf6b71991c..e2eed4892221 100644 --- a/utils/phpstan-baseline/loader.neon +++ b/utils/phpstan-baseline/loader.neon @@ -1,4 +1,4 @@ -# total 607 errors +# total 572 errors includes: - argument.type.neon diff --git a/utils/phpstan-baseline/missingType.iterableValue.neon b/utils/phpstan-baseline/missingType.iterableValue.neon index a70bd3c72915..f8c8995deaa0 100644 --- a/utils/phpstan-baseline/missingType.iterableValue.neon +++ b/utils/phpstan-baseline/missingType.iterableValue.neon @@ -1,4 +1,4 @@ -# total 440 errors +# total 415 errors parameters: ignoreErrors: @@ -317,41 +317,6 @@ parameters: count: 1 path: ../../system/DataConverter/DataConverter.php - - - message: '#^Method CodeIgniter\\Database\\BasePreparedQuery\:\:_execute\(\) has parameter \$data with no value type specified in iterable type array\.$#' - count: 1 - path: ../../system/Database/BasePreparedQuery.php - - - - message: '#^Method CodeIgniter\\Database\\BasePreparedQuery\:\:_prepare\(\) has parameter \$options with no value type specified in iterable type array\.$#' - count: 1 - path: ../../system/Database/BasePreparedQuery.php - - - - message: '#^Method CodeIgniter\\Database\\BasePreparedQuery\:\:prepare\(\) has parameter \$options with no value type specified in iterable type array\.$#' - count: 1 - path: ../../system/Database/BasePreparedQuery.php - - - - message: '#^Method CodeIgniter\\Database\\BaseUtils\:\:_backup\(\) has parameter \$prefs with no value type specified in iterable type array\.$#' - count: 1 - path: ../../system/Database/BaseUtils.php - - - - message: '#^Method CodeIgniter\\Database\\BaseUtils\:\:backup\(\) has parameter \$params with no value type specified in iterable type array\.$#' - count: 1 - path: ../../system/Database/BaseUtils.php - - - - message: '#^Method CodeIgniter\\Database\\BaseUtils\:\:getXMLFromResult\(\) has parameter \$params with no value type specified in iterable type array\.$#' - count: 1 - path: ../../system/Database/BaseUtils.php - - - - message: '#^Method CodeIgniter\\Database\\BaseUtils\:\:listDatabases\(\) return type has no value type specified in iterable type array\.$#' - count: 1 - path: ../../system/Database/BaseUtils.php - - message: '#^Method CodeIgniter\\Database\\Config\:\:connect\(\) has parameter \$group with no value type specified in iterable type array\.$#' count: 1 @@ -442,56 +407,6 @@ parameters: count: 1 path: ../../system/Database/MigrationRunner.php - - - message: '#^Method CodeIgniter\\Database\\MySQLi\\PreparedQuery\:\:_execute\(\) has parameter \$data with no value type specified in iterable type array\.$#' - count: 1 - path: ../../system/Database/MySQLi/PreparedQuery.php - - - - message: '#^Method CodeIgniter\\Database\\MySQLi\\PreparedQuery\:\:_prepare\(\) has parameter \$options with no value type specified in iterable type array\.$#' - count: 1 - path: ../../system/Database/MySQLi/PreparedQuery.php - - - - message: '#^Method CodeIgniter\\Database\\MySQLi\\Utils\:\:_backup\(\) has parameter \$prefs with no value type specified in iterable type array\.$#' - count: 1 - path: ../../system/Database/MySQLi/Utils.php - - - - message: '#^Method CodeIgniter\\Database\\OCI8\\PreparedQuery\:\:_execute\(\) has parameter \$data with no value type specified in iterable type array\.$#' - count: 1 - path: ../../system/Database/OCI8/PreparedQuery.php - - - - message: '#^Method CodeIgniter\\Database\\OCI8\\PreparedQuery\:\:_prepare\(\) has parameter \$options with no value type specified in iterable type array\.$#' - count: 1 - path: ../../system/Database/OCI8/PreparedQuery.php - - - - message: '#^Method CodeIgniter\\Database\\OCI8\\Utils\:\:_backup\(\) has parameter \$prefs with no value type specified in iterable type array\.$#' - count: 1 - path: ../../system/Database/OCI8/Utils.php - - - - message: '#^Method CodeIgniter\\Database\\Postgre\\PreparedQuery\:\:_execute\(\) has parameter \$data with no value type specified in iterable type array\.$#' - count: 1 - path: ../../system/Database/Postgre/PreparedQuery.php - - - - message: '#^Method CodeIgniter\\Database\\Postgre\\PreparedQuery\:\:_prepare\(\) has parameter \$options with no value type specified in iterable type array\.$#' - count: 1 - path: ../../system/Database/Postgre/PreparedQuery.php - - - - message: '#^Method CodeIgniter\\Database\\Postgre\\Utils\:\:_backup\(\) has parameter \$prefs with no value type specified in iterable type array\.$#' - count: 1 - path: ../../system/Database/Postgre/Utils.php - - - - message: '#^Method CodeIgniter\\Database\\PreparedQueryInterface\:\:prepare\(\) has parameter \$options with no value type specified in iterable type array\.$#' - count: 1 - path: ../../system/Database/PreparedQueryInterface.php - - message: '#^Method CodeIgniter\\Database\\Query\:\:matchNamedBinds\(\) has parameter \$binds with no value type specified in iterable type array\.$#' count: 1 @@ -512,41 +427,6 @@ parameters: count: 1 path: ../../system/Database/Query.php - - - message: '#^Method CodeIgniter\\Database\\SQLSRV\\PreparedQuery\:\:_execute\(\) has parameter \$data with no value type specified in iterable type array\.$#' - count: 1 - path: ../../system/Database/SQLSRV/PreparedQuery.php - - - - message: '#^Method CodeIgniter\\Database\\SQLSRV\\PreparedQuery\:\:_prepare\(\) has parameter \$options with no value type specified in iterable type array\.$#' - count: 1 - path: ../../system/Database/SQLSRV/PreparedQuery.php - - - - message: '#^Method CodeIgniter\\Database\\SQLSRV\\PreparedQuery\:\:parameterize\(\) return type has no value type specified in iterable type array\.$#' - count: 1 - path: ../../system/Database/SQLSRV/PreparedQuery.php - - - - message: '#^Property CodeIgniter\\Database\\SQLSRV\\PreparedQuery\:\:\$parameters type has no value type specified in iterable type array\.$#' - count: 1 - path: ../../system/Database/SQLSRV/PreparedQuery.php - - - - message: '#^Method CodeIgniter\\Database\\SQLSRV\\Utils\:\:_backup\(\) has parameter \$prefs with no value type specified in iterable type array\.$#' - count: 1 - path: ../../system/Database/SQLSRV/Utils.php - - - - message: '#^Method CodeIgniter\\Database\\SQLite3\\PreparedQuery\:\:_execute\(\) has parameter \$data with no value type specified in iterable type array\.$#' - count: 1 - path: ../../system/Database/SQLite3/PreparedQuery.php - - - - message: '#^Method CodeIgniter\\Database\\SQLite3\\PreparedQuery\:\:_prepare\(\) has parameter \$options with no value type specified in iterable type array\.$#' - count: 1 - path: ../../system/Database/SQLite3/PreparedQuery.php - - message: '#^Method CodeIgniter\\Database\\SQLite3\\Table\:\:addForeignKey\(\) has parameter \$foreignKeys with no value type specified in iterable type array\.$#' count: 1 @@ -577,11 +457,6 @@ parameters: count: 1 path: ../../system/Database/SQLite3/Table.php - - - message: '#^Method CodeIgniter\\Database\\SQLite3\\Utils\:\:_backup\(\) has parameter \$prefs with no value type specified in iterable type array\.$#' - count: 1 - path: ../../system/Database/SQLite3/Utils.php - - message: '#^Method CodeIgniter\\Debug\\BaseExceptionHandler\:\:collectVars\(\) return type has no value type specified in iterable type array\.$#' count: 1 diff --git a/utils/phpstan-baseline/missingType.parameter.neon b/utils/phpstan-baseline/missingType.parameter.neon index 5efe82a4824a..baa8330cffd4 100644 --- a/utils/phpstan-baseline/missingType.parameter.neon +++ b/utils/phpstan-baseline/missingType.parameter.neon @@ -1,17 +1,7 @@ -# total 15 errors +# total 13 errors parameters: ignoreErrors: - - - message: '#^Method CodeIgniter\\Database\\BasePreparedQuery\:\:execute\(\) has parameter \$data with no type specified\.$#' - count: 1 - path: ../../system/Database/BasePreparedQuery.php - - - - message: '#^Method CodeIgniter\\Database\\PreparedQueryInterface\:\:execute\(\) has parameter \$data with no type specified\.$#' - count: 1 - path: ../../system/Database/PreparedQueryInterface.php - - message: '#^Method CodeIgniter\\Commands\\Utilities\\Routes\\AutoRouterImproved\\Controllers\\Dash_folder\\Dash_controller\:\:getDash_method\(\) has parameter \$p1 with no type specified\.$#' count: 1 diff --git a/utils/phpstan-baseline/property.phpDocType.neon b/utils/phpstan-baseline/property.phpDocType.neon index 275166c25508..fbbec53d281e 100644 --- a/utils/phpstan-baseline/property.phpDocType.neon +++ b/utils/phpstan-baseline/property.phpDocType.neon @@ -1,47 +1,7 @@ -# total 17 errors +# total 9 errors parameters: ignoreErrors: - - - message: '#^PHPDoc type string of property CodeIgniter\\Database\\MySQLi\\Utils\:\:\$listDatabases is not the same as PHPDoc type bool\|string of overridden property CodeIgniter\\Database\\BaseUtils\:\:\$listDatabases\.$#' - count: 1 - path: ../../system/Database/MySQLi/Utils.php - - - - message: '#^PHPDoc type string of property CodeIgniter\\Database\\MySQLi\\Utils\:\:\$optimizeTable is not the same as PHPDoc type bool\|string of overridden property CodeIgniter\\Database\\BaseUtils\:\:\$optimizeTable\.$#' - count: 1 - path: ../../system/Database/MySQLi/Utils.php - - - - message: '#^PHPDoc type string of property CodeIgniter\\Database\\OCI8\\Utils\:\:\$listDatabases is not the same as PHPDoc type bool\|string of overridden property CodeIgniter\\Database\\BaseUtils\:\:\$listDatabases\.$#' - count: 1 - path: ../../system/Database/OCI8/Utils.php - - - - message: '#^PHPDoc type string of property CodeIgniter\\Database\\Postgre\\Utils\:\:\$listDatabases is not the same as PHPDoc type bool\|string of overridden property CodeIgniter\\Database\\BaseUtils\:\:\$listDatabases\.$#' - count: 1 - path: ../../system/Database/Postgre/Utils.php - - - - message: '#^PHPDoc type string of property CodeIgniter\\Database\\Postgre\\Utils\:\:\$optimizeTable is not the same as PHPDoc type bool\|string of overridden property CodeIgniter\\Database\\BaseUtils\:\:\$optimizeTable\.$#' - count: 1 - path: ../../system/Database/Postgre/Utils.php - - - - message: '#^PHPDoc type string of property CodeIgniter\\Database\\SQLSRV\\Utils\:\:\$listDatabases is not the same as PHPDoc type bool\|string of overridden property CodeIgniter\\Database\\BaseUtils\:\:\$listDatabases\.$#' - count: 1 - path: ../../system/Database/SQLSRV/Utils.php - - - - message: '#^PHPDoc type string of property CodeIgniter\\Database\\SQLSRV\\Utils\:\:\$optimizeTable is not the same as PHPDoc type bool\|string of overridden property CodeIgniter\\Database\\BaseUtils\:\:\$optimizeTable\.$#' - count: 1 - path: ../../system/Database/SQLSRV/Utils.php - - - - message: '#^PHPDoc type string of property CodeIgniter\\Database\\SQLite3\\Utils\:\:\$optimizeTable is not the same as PHPDoc type bool\|string of overridden property CodeIgniter\\Database\\BaseUtils\:\:\$optimizeTable\.$#' - count: 1 - path: ../../system/Database/SQLite3/Utils.php - - message: '#^PHPDoc type int of property CodeIgniter\\Exceptions\\PageNotFoundException\:\:\$code is not the same as PHPDoc type mixed of overridden property Exception\:\:\$code\.$#' count: 1