Total Complexity | 10 |
Total Lines | 44 |
Duplicated Lines | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
7 | trait LimitBuilder { |
||
8 | private null|int|OptionalValue $limit = null; |
||
9 | |||
10 | /** |
||
11 | * @return null|int |
||
12 | */ |
||
13 | protected function getLimit(): ?int { |
||
14 | if($this->limit instanceof OptionalValue) { |
||
15 | return $this->limit->getValue(); |
||
16 | } |
||
17 | return $this->limit; |
||
18 | } |
||
19 | |||
20 | /** |
||
21 | * @param null|int|OptionalValue $limit |
||
22 | * @return $this |
||
23 | */ |
||
24 | public function limit($limit) { |
||
27 | } |
||
28 | |||
29 | /** |
||
30 | * @param string $query |
||
31 | * @param int|null $offset |
||
32 | * @return string |
||
33 | */ |
||
34 | protected function buildLimit(string $query, ?int $offset = null) { |
||
53 |