Skip to content

Commit c02ce68

Browse files
committed
docs: make array type more precise
1 parent 9ae7f43 commit c02ce68

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

system/Test/Interfaces/FabricatorModel.php

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313

1414
namespace CodeIgniter\Test\Interfaces;
1515

16+
use CodeIgniter\BaseModel;
1617
use Faker\Generator;
1718
use ReflectionException;
1819

@@ -27,25 +28,28 @@
2728
* @property string $returnType
2829
* @property string $primaryKey
2930
* @property string $dateFormat
31+
*
32+
* @phpstan-import-type row_array from BaseModel
3033
*/
3134
interface FabricatorModel
3235
{
3336
/**
3437
* Fetches the row of database from $this->table with a primary key
3538
* matching $id.
3639
*
37-
* @param array|mixed|null $id One primary key or an array of primary keys
40+
* @param int|list<int|string>|string|null $id One primary key or an array of primary keys
3841
*
39-
* @return array|object|null The resulting row of data, or null.
42+
* @phpstan-return ($id is int|string ? row_array|object|null : list<row_array|object>)
4043
*/
4144
public function find($id = null);
4245

4346
/**
4447
* Inserts data into the current table. If an object is provided,
4548
* it will attempt to convert it to an array.
4649
*
47-
* @param array|object $data
48-
* @param bool $returnID Whether insert ID should be returned or not.
50+
* @param array|object|null $row
51+
* @phpstan-param row_array|object|null $row
52+
* @param bool $returnID Whether insert ID should be returned or not.
4953
*
5054
* @return bool|int|string
5155
*

0 commit comments

Comments
 (0)