Skip to content

Commit 6d971af

Browse files
committed
docs: improve doc comments
1 parent eb88917 commit 6d971af

File tree

2 files changed

+16
-12
lines changed

2 files changed

+16
-12
lines changed

system/Database/BaseResult.php

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -252,14 +252,16 @@ public function getResultObject(): array
252252
* Wrapper object to return a row as either an array, an object, or
253253
* a custom class.
254254
*
255-
* If row doesn't exist, returns null.
255+
* If the row doesn't exist, returns null.
256+
*
257+
* @template T of object
256258
*
257-
* @param int|string $n The index of the results to return, or column name.
258-
* @param string $type The type of result object. 'array', 'object' or class name.
259-
* @phpstan-param class-string|'array'|'object' $type
259+
* @param int|string $n The index of the results to return, or column name.
260+
* @param string $type The type of result object. 'array', 'object' or class name.
261+
* @phpstan-param class-string<T>|'array'|'object' $type
260262
*
261263
* @return array|object|stdClass|null
262-
* @phpstan-return ($type is 'object' ? stdClass|null : ($type is 'array' ? array|null : object|null))
264+
* @phpstan-return ($type is 'object' ? stdClass|null : ($type is 'array' ? array|null : T|null))
263265
*/
264266
public function getRow($n = 0, string $type = 'object')
265267
{
@@ -296,7 +298,7 @@ public function getRow($n = 0, string $type = 'object')
296298
*
297299
* @template T of object
298300
*
299-
* @param int $n The row number of the results
301+
* @param int $n The index of the results to return.
300302
* @phpstan-param class-string<T> $className
301303
*
302304
* @return object|null

system/Database/ResultInterface.php

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -55,14 +55,16 @@ public function getResultObject(): array;
5555
* Wrapper object to return a row as either an array, an object, or
5656
* a custom class.
5757
*
58-
* If row doesn't exist, returns null.
58+
* If the row doesn't exist, returns null.
59+
*
60+
* @template T of object
5961
*
60-
* @param int|string $n The index of the results to return, or column name.
61-
* @param string $type The type of result object. 'array', 'object' or class name.
62-
* @phpstan-param class-string|'array'|'object' $type
62+
* @param int|string $n The index of the results to return, or column name.
63+
* @param string $type The type of result object. 'array', 'object' or class name.
64+
* @phpstan-param class-string<T>|'array'|'object' $type
6365
*
6466
* @return array|object|stdClass|null
65-
* @phpstan-return ($type is 'object' ? stdClass|null : ($type is 'array' ? array|null : object|null))
67+
* @phpstan-return ($type is 'object' ? stdClass|null : ($type is 'array' ? array|null : T|null))
6668
*/
6769
public function getRow($n = 0, string $type = 'object');
6870

@@ -73,7 +75,7 @@ public function getRow($n = 0, string $type = 'object');
7375
*
7476
* @template T of object
7577
*
76-
* @param int $n The row number of the results
78+
* @param int $n The index of the results to return.
7779
* @phpstan-param class-string<T> $className
7880
*
7981
* @return object|null

0 commit comments

Comments
 (0)