Skip to content

Commit

Permalink
添加注释
Browse files Browse the repository at this point in the history
  • Loading branch information
何平 committed Jan 22, 2024
1 parent 5317055 commit 6d6fdad
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions cloud-admin/Trait/PaginateTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,12 @@

trait PaginateTrait
{
/**
* @phpstan-param array|string $select
* @phpstan-param array $params
* @phpstan-param array $order
* @phpstan-return array
*/
public function getList(array|string $select, array $params, array $order = []): array
{
$query = $this->buildByCondition($params);
Expand All @@ -32,6 +38,10 @@ public function getList(array|string $select, array $params, array $order = []):
}

/**
* @phpstan-param array|string $select
* @phpstan-param array $params
* @phpstan-param array $order
* @phpstan-param array $page
* @return array{items: array, pageInfo: array}
*/
public function getPageList(array|string $select, array $params, array $order = [], array $page = []): array
Expand All @@ -53,6 +63,8 @@ public function getPageList(array|string $select, array $params, array $order =
}

/**
* @phpstan-param LengthAwarePaginatorInterface $paginator
* @phpstan-param array $params
* @return array{list: array, total: int, currentPage: int, totalPage: int}
*/
public function setPaginate(LengthAwarePaginatorInterface $paginator, array $params = []): array
Expand All @@ -65,6 +77,11 @@ public function setPaginate(LengthAwarePaginatorInterface $paginator, array $par
];
}

/**
* @phpstan-param Builder $builder
* @phpstan-param array $params
* @return Builder
*/
public function order(Builder $builder, array $params = []): Builder
{
if ($params) {
Expand Down

0 comments on commit 6d6fdad

Please sign in to comment.