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;
|
namespace CodeIgniter\Test\Interfaces;
|
||||||
|
|
||||||
|
use CodeIgniter\BaseModel;
|
||||||
use Faker\Generator;
|
use Faker\Generator;
|
||||||
use ReflectionException;
|
use ReflectionException;
|
||||||
|
|
||||||
@ -27,6 +28,8 @@ use ReflectionException;
|
|||||||
* @property string $returnType
|
* @property string $returnType
|
||||||
* @property string $primaryKey
|
* @property string $primaryKey
|
||||||
* @property string $dateFormat
|
* @property string $dateFormat
|
||||||
|
*
|
||||||
|
* @phpstan-import-type row_array from BaseModel
|
||||||
*/
|
*/
|
||||||
interface FabricatorModel
|
interface FabricatorModel
|
||||||
{
|
{
|
||||||
@ -34,9 +37,9 @@ interface FabricatorModel
|
|||||||
* Fetches the row of database from $this->table with a primary key
|
* Fetches the row of database from $this->table with a primary key
|
||||||
* matching $id.
|
* 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);
|
public function find($id = null);
|
||||||
|
|
||||||
@ -44,7 +47,8 @@ interface FabricatorModel
|
|||||||
* Inserts data into the current table. If an object is provided,
|
* Inserts data into the current table. If an object is provided,
|
||||||
* it will attempt to convert it to an array.
|
* it will attempt to convert it to an array.
|
||||||
*
|
*
|
||||||
* @param array|object $data
|
* @param array|object|null $row
|
||||||
|
* @phpstan-param row_array|object|null $row
|
||||||
* @param bool $returnID Whether insert ID should be returned or not.
|
* @param bool $returnID Whether insert ID should be returned or not.
|
||||||
*
|
*
|
||||||
* @return bool|int|string
|
* @return bool|int|string
|
||||||
|
Loading…
x
Reference in New Issue
Block a user