Total Complexity | 7 |
Total Lines | 37 |
Duplicated Lines | 0 % |
Coverage | 100% |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
5 | trait HasResponsePagination |
||
6 | { |
||
7 | abstract protected function entityKey(): string; |
||
8 | |||
9 | 1 | public function total(): int |
|
10 | { |
||
11 | 1 | return (int) $this->baseResponse()->json("{$this->entityKey()}.total", 0); |
|
|
|||
12 | } |
||
13 | |||
14 | 1 | public function perPage(): int |
|
17 | } |
||
18 | |||
19 | 1 | public function currentPage(): int |
|
20 | { |
||
21 | 1 | return (int) $this->baseResponse()->json("{$this->entityKey()}.current_page", 0); |
|
22 | } |
||
23 | |||
24 | 1 | public function lastPage(): int |
|
25 | { |
||
26 | 1 | return (int) $this->baseResponse()->json("{$this->entityKey()}.last_page", 0); |
|
27 | } |
||
28 | |||
29 | 1 | public function from(): int |
|
30 | { |
||
31 | 1 | return (int) $this->baseResponse()->json("{$this->entityKey()}.from", 0); |
|
32 | } |
||
33 | |||
34 | 1 | public function to(): int |
|
35 | { |
||
36 | 1 | return (int) $this->baseResponse()->json("{$this->entityKey()}.to", 0); |
|
37 | } |
||
38 | |||
39 | 1 | public function items(): array |
|
42 | } |
||
43 | } |
||
44 |