2525use Throwable ;
2626
2727/**
28- * @property-read array $aliasedTables
29- * @property-read string $charset
30- * @property-read bool $compress
31- * @property-read float $connectDuration
32- * @property-read float $connectTime
33- * @property-read string $database
34- * @property-read array $dateFormat
35- * @property-read string $DBCollat
36- * @property-read bool $DBDebug
37- * @property-read string $DBDriver
38- * @property-read string $DBPrefix
39- * @property-read string $DSN
40- * @property-read array|bool $encrypt
41- * @property-read array $failover
42- * @property-read string $hostname
43- * @property-read Query $lastQuery
44- * @property-read string $password
45- * @property-read bool $pConnect
46- * @property-read int|string $port
47- * @property-read bool $pretend
48- * @property-read string $queryClass
49- * @property-read array $reservedIdentifiers
50- * @property-read bool $strictOn
51- * @property-read string $subdriver
52- * @property-read string $swapPre
53- * @property-read int $transDepth
54- * @property-read bool $transFailure
55- * @property-read bool $transStatus
56- * @property-read string $username
28+ * @property-read list<string> $aliasedTables
29+ * @property-read string $charset
30+ * @property-read bool $compress
31+ * @property-read float $connectDuration
32+ * @property-read float $connectTime
33+ * @property-read string $database
34+ * @property-read array<string, string> $dateFormat
35+ * @property-read string $DBCollat
36+ * @property-read bool $DBDebug
37+ * @property-read string $DBDriver
38+ * @property-read string $DBPrefix
39+ * @property-read string $DSN
40+ * @property-read array<string, bool|string> |bool $encrypt
41+ * @property-read list< array<string, mixed>> $failover
42+ * @property-read string $hostname
43+ * @property-read Query $lastQuery
44+ * @property-read string $password
45+ * @property-read bool $pConnect
46+ * @property-read int|string $port
47+ * @property-read bool $pretend
48+ * @property-read string $queryClass
49+ * @property-read list<string> $reservedIdentifiers
50+ * @property-read bool $strictOn
51+ * @property-read string $subdriver
52+ * @property-read string $swapPre
53+ * @property-read int $transDepth
54+ * @property-read bool $transFailure
55+ * @property-read bool $transStatus
56+ * @property-read string $username
5757 *
5858 * @template TConnection
5959 * @template TResult
@@ -177,7 +177,7 @@ abstract class BaseConnection implements ConnectionInterface
177177 /**
178178 * Encryption flag/data
179179 *
180- * @var array|bool
180+ * @var array<string, bool|string> |bool
181181 */
182182 protected $ encrypt = false ;
183183
@@ -202,7 +202,7 @@ abstract class BaseConnection implements ConnectionInterface
202202 /**
203203 * Settings for a failover connection.
204204 *
205- * @var array
205+ * @var list< array<string, mixed>>
206206 */
207207 protected $ failover = [];
208208
@@ -240,14 +240,14 @@ abstract class BaseConnection implements ConnectionInterface
240240 *
241241 * Identifiers that must NOT be escaped.
242242 *
243- * @var array
243+ * @var list<string>
244244 */
245245 protected $ reservedIdentifiers = ['* ' ];
246246
247247 /**
248248 * Identifier escape character
249249 *
250- * @var array |string
250+ * @var list<string> |string
251251 */
252252 public $ escapeChar = '" ' ;
253253
@@ -268,15 +268,12 @@ abstract class BaseConnection implements ConnectionInterface
268268 /**
269269 * RegExp used to escape identifiers
270270 *
271- * @var array
271+ * @var list<string>
272272 */
273273 protected $ pregEscapeChar = [];
274274
275275 /**
276- * Holds previously looked up data
277- * for performance reasons.
278- *
279- * @var array
276+ * @var array<string, mixed>
280277 */
281278 public $ dataCache = [];
282279
@@ -374,7 +371,7 @@ abstract class BaseConnection implements ConnectionInterface
374371 ];
375372
376373 /**
377- * Saves our connection settings.
374+ * @param array<string, mixed> $params
378375 */
379376 public function __construct (array $ params )
380377 {
@@ -739,6 +736,8 @@ public function getPlatform(): string
739736 * collected during use of the Builder, and set here
740737 * so queries are built correctly.
741738 *
739+ * @param list<string> $aliases
740+ *
742741 * @return $this
743742 */
744743 public function setAliasedTables (array $ aliases )
@@ -1111,7 +1110,7 @@ abstract protected function _transRollback(): bool;
11111110 /**
11121111 * Returns a non-shared new instance of the query builder for this connection.
11131112 *
1114- * @param array|string|TableName $tableName
1113+ * @param array<array-key, string> |string|TableName $tableName
11151114 *
11161115 * @return BaseBuilder
11171116 *
@@ -1156,6 +1155,7 @@ public function newQuery(): BaseBuilder
11561155 * })
11571156 *
11581157 * @param Closure(BaseConnection): mixed $func
1158+ * @param array<string, mixed> $options
11591159 *
11601160 * @return BasePreparedQuery|null
11611161 */
@@ -1242,12 +1242,12 @@ public function getConnectDuration(int $decimals = 6): string
12421242 * insert the table prefix (if it exists) in the proper position, and escape only
12431243 * the correct identifiers.
12441244 *
1245- * @param array|int|string|TableName $item
1246- * @param bool $prefixSingle Prefix a table name with no segments?
1247- * @param bool $protectIdentifiers Protect table or column names?
1248- * @param bool $fieldExists Supplied $item contains a column name?
1245+ * @param array<array-key, mixed> |int|string|TableName $item
1246+ * @param bool $prefixSingle Prefix a table name with no segments?
1247+ * @param bool $protectIdentifiers Protect table or column names?
1248+ * @param bool $fieldExists Supplied $item contains a column name?
12491249 *
1250- * @return ($item is array ? array : string)
1250+ * @return ($item is array ? array<array-key, mixed> : string)
12511251 */
12521252 public function protectIdentifiers ($ item , bool $ prefixSingle = false , ?bool $ protectIdentifiers = null , bool $ fieldExists = true )
12531253 {
@@ -1448,9 +1448,9 @@ private function escapeTableName(TableName $tableName): string
14481448 *
14491449 * This function escapes column and table names
14501450 *
1451- * @param array|string $item
1451+ * @param array<array-key, mixed> |string $item
14521452 *
1453- * @return ($item is array ? array : string)
1453+ * @return ($item is array ? array<array-key, mixed> : string)
14541454 */
14551455 public function escapeIdentifiers ($ item )
14561456 {
@@ -1534,7 +1534,7 @@ abstract public function affectedRows(): int;
15341534 *
15351535 * @param mixed $str
15361536 *
1537- * @return ($str is array ? array : float|int|string)
1537+ * @return ($str is array ? array<array-key, mixed> : float|int|string)
15381538 */
15391539 public function escape ($ str )
15401540 {
@@ -1638,7 +1638,7 @@ protected function _escapeString(string $str): string
16381638 * This function enables you to call PHP database functions that are not natively included
16391639 * in CodeIgniter, in a platform independent manner.
16401640 *
1641- * @param array ...$params
1641+ * @param mixed ...$params
16421642 *
16431643 * @throws DatabaseException
16441644 */
@@ -1682,7 +1682,7 @@ protected function getDriverFunctionPrefix(): string
16821682 */
16831683 public function listTables (bool $ constrainByPrefix = false )
16841684 {
1685- if (isset ($ this ->dataCache ['table_names ' ]) && $ this -> dataCache [ ' table_names ' ]) {
1685+ if (($ this ->dataCache ['table_names ' ] ?? []) !== [ ]) {
16861686 $ tables = $ constrainByPrefix
16871687 ? preg_grep ("/^ {$ this ->DBPrefix }/ " , $ this ->dataCache ['table_names ' ])
16881688 : $ this ->dataCache ['table_names ' ];
@@ -1847,21 +1847,18 @@ public function getForeignKeyData(string $table)
18471847 /**
18481848 * Converts array of arrays generated by _foreignKeyData() to array of objects
18491849 *
1850- * @return array<string, stdClass>
1850+ * @param array<array-key, array{
1851+ * constraint_name: string|null,
1852+ * table_name: string,
1853+ * column_name: list<string>,
1854+ * foreign_table_name: string,
1855+ * foreign_column_name: list<string>,
1856+ * on_delete: string,
1857+ * on_update: string|null,
1858+ * match: string|null,
1859+ * }> $data
18511860 *
1852- * array[
1853- * {constraint_name} =>
1854- * stdClass[
1855- * 'constraint_name' => string,
1856- * 'table_name' => string,
1857- * 'column_name' => string[],
1858- * 'foreign_table_name' => string,
1859- * 'foreign_column_name' => string[],
1860- * 'on_delete' => string,
1861- * 'on_update' => string,
1862- * 'match' => string
1863- * ]
1864- * ]
1861+ * @return array<string, stdClass>
18651862 */
18661863 protected function foreignKeyDataToObjects (array $ data )
18671864 {
0 commit comments