| Total Complexity | 13 |
| Total Lines | 53 |
| 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 | $value = $this->limit->getValue(); |
||
| 16 | if(is_numeric($value)) { |
||
| 17 | return (int) $value; |
||
| 18 | } |
||
| 19 | return null; |
||
| 20 | } |
||
| 21 | return $this->limit; |
||
| 22 | } |
||
| 23 | |||
| 24 | /** |
||
| 25 | * @param null|int|OptionalValue $limit |
||
| 26 | * @return $this |
||
| 27 | */ |
||
| 28 | public function limit($limit) { |
||
| 31 | } |
||
| 32 | |||
| 33 | /** |
||
| 34 | * @param string $query |
||
| 35 | * @param int|null $offset |
||
| 36 | * @return string |
||
| 37 | */ |
||
| 38 | protected function buildLimit(string $query, ?int $offset = null) { |
||
| 62 |