Skip to content

Commit cd3d385

Browse files
committed
docs: replace type mixed at Database connection.
1 parent a564fe7 commit cd3d385

4 files changed

Lines changed: 14 additions & 12 deletions

File tree

system/Database/BaseConnection.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -456,7 +456,7 @@ abstract protected function _close();
456456
/**
457457
* Create a persistent database connection.
458458
*
459-
* @return mixed
459+
* @return false|object|resource
460460
*/
461461
public function persistentConnect()
462462
{
@@ -558,7 +558,7 @@ abstract protected function execute(string $sql);
558558
* Should automatically handle different connections for read/write
559559
* queries if needed.
560560
*
561-
* @param mixed ...$binds
561+
* @param array|string|null ...$binds
562562
*
563563
* @return BaseResult|bool|Query BaseResult when “read” type query, bool when “write” type query, Query when prepared query
564564
* @phpstan-return BaseResult<TConnection, TResult>|bool|Query
@@ -1747,7 +1747,7 @@ protected function _enableForeignKeyChecks()
17471747
/**
17481748
* Accessor for properties if they exist.
17491749
*
1750-
* @return mixed
1750+
* @return array|bool|float|int|object|resource|string|null
17511751
*/
17521752
public function __get(string $key)
17531753
{

system/Database/ConnectionInterface.php

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@
1212
namespace CodeIgniter\Database;
1313

1414
/**
15+
* @property Query $lastQuery
16+
*
1517
* @template TConnection of object|resource
1618
* @template TResult of object|resource
1719
*/
@@ -62,7 +64,7 @@ public function getConnection(?string $alias = null);
6264
/**
6365
* Select a specific database table to use.
6466
*
65-
* @return mixed
67+
* @return bool
6668
*/
6769
public function setDatabase(string $databaseName);
6870

@@ -98,7 +100,7 @@ public function getVersion(): string;
98100
* Should automatically handle different connections for read/write
99101
* queries if needed.
100102
*
101-
* @param mixed ...$binds
103+
* @param array|string|null ...$binds
102104
*
103105
* @return BaseResult|bool|Query
104106
* @phpstan-return BaseResult<TConnection, TResult>|bool|Query
@@ -127,7 +129,7 @@ public function table($tableName);
127129
/**
128130
* Returns the last query's statement object.
129131
*
130-
* @return mixed
132+
* @return Query
131133
*/
132134
public function getLastQuery();
133135

@@ -150,7 +152,7 @@ public function escape($str);
150152
*
151153
* @param array ...$params
152154
*
153-
* @return mixed
155+
* @return array|bool|float|int|object|resource|string|null
154156
*/
155157
public function callFunction(string $functionName, ...$params);
156158

system/Database/Postgre/Connection.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -533,7 +533,7 @@ protected function _transRollback(): bool
533533
*
534534
* Overrides BaseConnection::isWriteType, adding additional read query types.
535535
*
536-
* @param mixed $sql
536+
* @param string $sql
537537
*/
538538
public function isWriteType($sql): bool
539539
{

system/Database/SQLSRV/Connection.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ class Connection extends BaseConnection
4444
* FALSE or SQLSRV_CURSOR_FORWARD would increase performance,
4545
* but would disable num_rows() (and possibly insert_id())
4646
*
47-
* @var mixed
47+
* @var bool|string
4848
*/
4949
public $scrollable;
5050

@@ -436,7 +436,7 @@ public function affectedRows(): int
436436
/**
437437
* Select a specific database table to use.
438438
*
439-
* @return mixed
439+
* @return bool
440440
*/
441441
public function setDatabase(?string $databaseName = null)
442442
{
@@ -485,7 +485,7 @@ protected function execute(string $sql)
485485
/**
486486
* Returns the last error encountered by this connection.
487487
*
488-
* @return mixed
488+
* @return array<string, int|string>
489489
*
490490
* @deprecated Use `error()` instead.
491491
*/
@@ -546,7 +546,7 @@ public function getVersion(): string
546546
*
547547
* Overrides BaseConnection::isWriteType, adding additional read query types.
548548
*
549-
* @param mixed $sql
549+
* @param string $sql
550550
*/
551551
public function isWriteType($sql): bool
552552
{

0 commit comments

Comments
 (0)