@@ -252,14 +252,16 @@ public function getResultObject(): array
252
252
* Wrapper object to return a row as either an array, an object, or
253
253
* a custom class.
254
254
*
255
- * If row doesn't exist, returns null.
255
+ * If the row doesn't exist, returns null.
256
+ *
257
+ * @template T of object
256
258
*
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
260
262
*
261
263
* @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))
263
265
*/
264
266
public function getRow ($ n = 0 , string $ type = 'object ' )
265
267
{
@@ -292,9 +294,15 @@ public function getRow($n = 0, string $type = 'object')
292
294
/**
293
295
* Returns a row as a custom class instance.
294
296
*
295
- * If row doesn't exists , returns null.
297
+ * If the row doesn't exist , returns null.
296
298
*
297
- * @return array|null
299
+ * @template T of object
300
+ *
301
+ * @param int $n The index of the results to return.
302
+ * @phpstan-param class-string<T> $className
303
+ *
304
+ * @return object|null
305
+ * @phpstan-return T|null
298
306
*/
299
307
public function getCustomRowObject (int $ n , string $ className )
300
308
{
0 commit comments