docs: make array type more precise

This commit is contained in:
kenjis 2024-04-12 16:15:15 +09:00
parent 9ae7f43a81
commit c02ce684fb
No known key found for this signature in database
GPG Key ID: BD254878922AF198

View File

@ -13,6 +13,7 @@ declare(strict_types=1);
namespace CodeIgniter\Test\Interfaces;
use CodeIgniter\BaseModel;
use Faker\Generator;
use ReflectionException;
@ -27,6 +28,8 @@ use ReflectionException;
* @property string $returnType
* @property string $primaryKey
* @property string $dateFormat
*
* @phpstan-import-type row_array from BaseModel
*/
interface FabricatorModel
{
@ -34,9 +37,9 @@ interface FabricatorModel
* Fetches the row of database from $this->table with a primary key
* matching $id.
*
* @param array|mixed|null $id One primary key or an array of primary keys
* @param int|list<int|string>|string|null $id One primary key or an array of primary keys
*
* @return array|object|null The resulting row of data, or null.
* @phpstan-return ($id is int|string ? row_array|object|null : list<row_array|object>)
*/
public function find($id = null);
@ -44,8 +47,9 @@ interface FabricatorModel
* Inserts data into the current table. If an object is provided,
* it will attempt to convert it to an array.
*
* @param array|object $data
* @param bool $returnID Whether insert ID should be returned or not.
* @param array|object|null $row
* @phpstan-param row_array|object|null $row
* @param bool $returnID Whether insert ID should be returned or not.
*
* @return bool|int|string
*