Skip to content

Commit

Permalink
Format code (#7177)
Browse files Browse the repository at this point in the history
  • Loading branch information
limingxinleo authored Nov 28, 2024
1 parent 8695004 commit a53d261
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 19 deletions.
6 changes: 3 additions & 3 deletions src/Model/Builder.php
Original file line number Diff line number Diff line change
Expand Up @@ -657,7 +657,7 @@ public function get($columns = ['*'])
* Get the hydrated models without eager loading.
*
* @param array $columns
* @return \Hyperf\Database\Model\Model[]|static[]
* @return Model[]|static[]
*/
public function getModels($columns = ['*'])
{
Expand Down Expand Up @@ -862,7 +862,7 @@ public function cursorPaginate(?int $perPage = null, array|string $columns = ['*
/**
* Save a new model and return the instance.
*
* @return $this|\Hyperf\Database\Model\Model
* @return $this|Model
*/
public function create(array $attributes = [])
{
Expand All @@ -874,7 +874,7 @@ public function create(array $attributes = [])
/**
* Save a new model and return the instance. Allow mass-assignment.
*
* @return $this|\Hyperf\Database\Model\Model
* @return $this|Model
*/
public function forceCreate(array $attributes)
{
Expand Down
20 changes: 10 additions & 10 deletions src/Model/Collection.php
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ public function find($key, $default = null)
/**
* Load a set of relationships onto the collection.
*
* @param array<array-key, (callable(\Hyperf\Database\Model\Builder): mixed)|string>|string $relations
* @param array<array-key, (callable(Builder): mixed)|string>|string $relations
* @return $this
*/
public function load($relations)
Expand All @@ -87,7 +87,7 @@ public function load($relations)
/**
* Load a set of aggregations over relationship's column onto the collection.
*
* @param array<array-key, (callable(\Hyperf\Database\Model\Builder): mixed)|string>|string $relations
* @param array<array-key, (callable(Builder): mixed)|string>|string $relations
*/
public function loadAggregate(array|string $relations, string $column, ?string $function = null): static
{
Expand Down Expand Up @@ -121,7 +121,7 @@ public function loadAggregate(array|string $relations, string $column, ?string $
/**
* Load a set of relationship's max column values onto the collection.
*
* @param array<array-key, (callable(\Hyperf\Database\Model\Builder): mixed)|string>|string $relations
* @param array<array-key, (callable(Builder): mixed)|string>|string $relations
*/
public function loadMax(array $relations, string $column): static
{
Expand All @@ -131,7 +131,7 @@ public function loadMax(array $relations, string $column): static
/**
* Load a set of relationship's min column values onto the collection.
*
* @param array<array-key, (callable(\Hyperf\Database\Model\Builder): mixed)|string>|string $relations
* @param array<array-key, (callable(Builder): mixed)|string>|string $relations
*/
public function loadMin(array $relations, string $column): static
{
Expand All @@ -141,7 +141,7 @@ public function loadMin(array $relations, string $column): static
/**
* Load a set of relationship's column summations onto the collection.
*
* @param array<array-key, (callable(\Hyperf\Database\Model\Builder): mixed)|string>|string $relations
* @param array<array-key, (callable(Builder): mixed)|string>|string $relations
*/
public function loadSum(array|string $relations, string $column): static
{
Expand All @@ -151,7 +151,7 @@ public function loadSum(array|string $relations, string $column): static
/**
* Load a set of relationship's average column values onto the collection.
*
* @param array<array-key, (callable(\Hyperf\Database\Model\Builder): mixed)|string>|string $relations
* @param array<array-key, (callable(Builder): mixed)|string>|string $relations
*/
public function loadAvg(array|string $relations, string $column): static
{
Expand All @@ -161,7 +161,7 @@ public function loadAvg(array|string $relations, string $column): static
/**
* Load a set of relationship counts onto the collection.
*
* @param array<array-key, (callable(\Hyperf\Database\Model\Builder): mixed)|string>|string $relations
* @param array<array-key, (callable(Builder): mixed)|string>|string $relations
* @return $this
*/
public function loadCount($relations)
Expand Down Expand Up @@ -193,7 +193,7 @@ public function loadCount($relations)
/**
* Load a set of relationships onto the collection if they are not already eager loaded.
*
* @param array<array-key, (callable(\Hyperf\Database\Model\Builder): mixed)|string>|string $relations
* @param array<array-key, (callable(Builder): mixed)|string>|string $relations
* @return $this
*/
public function loadMissing($relations)
Expand Down Expand Up @@ -229,7 +229,7 @@ public function loadMissing($relations)
* Load a set of relationships onto the mixed relationship collection.
*
* @param string $relation
* @param array<array-key, (callable(\Hyperf\Database\Model\Builder): mixed)|string>|string $relations
* @param array<array-key, (callable(Builder): mixed)|string>|string $relations
* @return $this
*/
public function loadMorph($relation, $relations)
Expand All @@ -253,7 +253,7 @@ public function loadMorph($relation, $relations)
/**
* Load a set of relationship counts onto the mixed relationship collection.
*
* @param array<array-key, (callable(\Hyperf\Database\Model\Builder): mixed)|string> $relations
* @param array<array-key, (callable(Builder): mixed)|string> $relations
* @return $this
*/
public function loadMorphCount(string $relation, array $relations)
Expand Down
8 changes: 4 additions & 4 deletions src/Schema/Blueprint.php
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ class Blueprint
/**
* The columns that should be added to the table.
*
* @var \Hyperf\Database\Schema\ColumnDefinition[]
* @var ColumnDefinition[]
*/
protected $columns = [];

Expand Down Expand Up @@ -1316,7 +1316,7 @@ public function getComment()
/**
* Get the columns on the blueprint.
*
* @return \Hyperf\Database\Schema\ColumnDefinition[]
* @return ColumnDefinition[]
*/
public function getColumns()
{
Expand All @@ -1336,7 +1336,7 @@ public function getCommands()
/**
* Get the columns on the blueprint that should be added.
*
* @return \Hyperf\Database\Schema\ColumnDefinition[]
* @return ColumnDefinition[]
*/
public function getAddedColumns()
{
Expand All @@ -1348,7 +1348,7 @@ public function getAddedColumns()
/**
* Get the columns on the blueprint that should be changed.
*
* @return \Hyperf\Database\Schema\ColumnDefinition[]
* @return ColumnDefinition[]
*/
public function getChangedColumns()
{
Expand Down
3 changes: 2 additions & 1 deletion tests/Stubs/Model/User.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
namespace HyperfTest\Database\Stubs\Model;

use Carbon\Carbon;
use Hyperf\Database\Model\Collection;

/**
* @property int $id
Expand All @@ -21,7 +22,7 @@
* @property Carbon $created_at
* @property Carbon $updated_at
* @property Book $book
* @property Book[]|\Hyperf\Database\Model\Collection $books
* @property Book[]|Collection $books
*/
class User extends Model
{
Expand Down
3 changes: 2 additions & 1 deletion tests/Stubs/Model/UserRole.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,15 @@
namespace HyperfTest\Database\Stubs\Model;

use Carbon\Carbon;
use Hyperf\Database\Model\Collection;

/**
* @property int $id
* @property int $user_id
* @property int $role_id
* @property Carbon $created_at
* @property Carbon $updated_at
* @property \App\Model\User[]|\Hyperf\Database\Model\Collection $users
* @property \App\Model\User[]|Collection $users
*/
class UserRole extends Model
{
Expand Down

0 comments on commit a53d261

Please sign in to comment.