mirror of
https://github.com/codeigniter4/CodeIgniter4.git
synced 2025-02-20 11:44:28 +08:00
docs: make array type more precise
This commit is contained in:
parent
9ae7f43a81
commit
c02ce684fb
@ -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
|
||||
*
|
||||
|
Loading…
x
Reference in New Issue
Block a user