Skip to content

Commit

Permalink
为create和update的data添加object类型
Browse files Browse the repository at this point in the history
  • Loading branch information
WIN-R3GECKV7AMT\Administrator committed Sep 13, 2024
1 parent 14b8bde commit 6d859b8
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions src/Model.php
Original file line number Diff line number Diff line change
Expand Up @@ -937,14 +937,14 @@ public function delete(): bool
/**
* 写入数据.
*
* @param array $data 数据数组
* @param array $allowField 允许字段
* @param bool $replace 使用Replace
* @param string $suffix 数据表后缀
* @param array|object $data 数据
* @param array $allowField 允许字段
* @param bool $replace 使用Replace
* @param string $suffix 数据表后缀
*
* @return static
*/
public static function create(array $data, array $allowField = [], bool $replace = false, string $suffix = ''): Model
public static function create(array | object $data, array $allowField = [], bool $replace = false, string $suffix = ''): Model

Check warning on line 947 in src/Model.php

View check run for this annotation

Codecov / codecov/patch

src/Model.php#L947

Added line #L947 was not covered by tests
{
$model = new static();

Expand All @@ -964,14 +964,14 @@ public static function create(array $data, array $allowField = [], bool $replace
/**
* 更新数据.
*
* @param array $data 数据数组
* @param mixed $where 更新条件
* @param array $allowField 允许字段
* @param string $suffix 数据表后缀
* @param array|object $data 数据数组
* @param mixed $where 更新条件
* @param array $allowField 允许字段
* @param string $suffix 数据表后缀
*
* @return static
*/
public static function update(array $data, $where = [], array $allowField = [], string $suffix = '')
public static function update(array | object $data, $where = [], array $allowField = [], string $suffix = '')

Check warning on line 974 in src/Model.php

View check run for this annotation

Codecov / codecov/patch

src/Model.php#L974

Added line #L974 was not covered by tests
{
$model = new static();

Expand Down

0 comments on commit 6d859b8

Please sign in to comment.