Skip to content

Commit 824ca83

Browse files
authored
Merge pull request #7436 from kenjis/fix-phpdoc-types-database
fix: PHPDoc @template and @return in database
2 parents c2842c6 + 377ef3d commit 824ca83

File tree

12 files changed

+29
-17
lines changed

12 files changed

+29
-17
lines changed

system/Database/BaseConnection.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,8 @@
4646
* @property bool $transFailure
4747
* @property bool $transStatus
4848
*
49-
* @template TConnection of object|resource
50-
* @template TResult of object|resource
49+
* @template TConnection
50+
* @template TResult
5151
*
5252
* @implements ConnectionInterface<TConnection, TResult>
5353
*/

system/Database/BasePreparedQuery.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,9 @@
1818
use ErrorException;
1919

2020
/**
21-
* @template TConnection of object|resource
22-
* @template TStatement of object|resource
23-
* @template TResult of object|resource
21+
* @template TConnection
22+
* @template TStatement
23+
* @template TResult
2424
*
2525
* @implements PreparedQueryInterface<TConnection, TStatement, TResult>
2626
*/

system/Database/BaseResult.php

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@
1515
use stdClass;
1616

1717
/**
18-
* @template TConnection of object|resource
19-
* @template TResult of object|resource
18+
* @template TConnection
19+
* @template TResult
2020
*
2121
* @implements ResultInterface<TConnection, TResult>
2222
*/
@@ -499,6 +499,8 @@ abstract public function getFieldData(): array;
499499

500500
/**
501501
* Frees the current result.
502+
*
503+
* @return void
502504
*/
503505
abstract public function freeResult();
504506

@@ -525,7 +527,7 @@ abstract protected function fetchAssoc();
525527
*
526528
* Overridden by child classes.
527529
*
528-
* @return object
530+
* @return Entity|false|object|stdClass
529531
*/
530532
abstract protected function fetchObject(string $className = 'stdClass');
531533
}

system/Database/ConnectionInterface.php

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

1414
/**
15-
* @template TConnection of object|resource
16-
* @template TResult of object|resource
15+
* @template TConnection
16+
* @template TResult
1717
*/
1818
interface ConnectionInterface
1919
{

system/Database/MySQLi/Result.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,8 @@ public function getFieldData(): array
103103

104104
/**
105105
* Frees the current result.
106+
*
107+
* @return void
106108
*/
107109
public function freeResult()
108110
{

system/Database/OCI8/Result.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313

1414
use CodeIgniter\Database\BaseResult;
1515
use CodeIgniter\Entity\Entity;
16+
use stdClass;
1617

1718
/**
1819
* Result for OCI8

system/Database/Postgre/Result.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,8 @@ public function getFieldData(): array
6969

7070
/**
7171
* Frees the current result.
72+
*
73+
* @return void
7274
*/
7375
public function freeResult()
7476
{

system/Database/PreparedQueryInterface.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@
1414
use BadMethodCallException;
1515

1616
/**
17-
* @template TConnection of object|resource
18-
* @template TStatement of object|resource
19-
* @template TResult of object|resource
17+
* @template TConnection
18+
* @template TStatement
19+
* @template TResult
2020
*/
2121
interface PreparedQueryInterface
2222
{

system/Database/ResultInterface.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@
1414
use stdClass;
1515

1616
/**
17-
* @template TConnection of object|resource
18-
* @template TResult of object|resource
17+
* @template TConnection
18+
* @template TResult
1919
*/
2020
interface ResultInterface
2121
{

system/Database/SQLSRV/Result.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,8 @@ public function getFieldData(): array
103103

104104
/**
105105
* Frees the current result.
106+
*
107+
* @return void
106108
*/
107109
public function freeResult()
108110
{

0 commit comments

Comments
 (0)