| Conditions | 3 |
| Paths | 3 |
| Total Lines | 14 |
| Code Lines | 7 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 7 |
| CRAP Score | 3 |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 18 | 2 | protected function getMeta(Query $query): ?array |
|
| 19 | { |
||
| 20 | 2 | if ($query->isWithMeta()) { |
|
| 21 | $meta = [ |
||
| 22 | 1 | 'offset' => $query->getOffset(), |
|
| 23 | 1 | 'limit' => $query->getLimit(), |
|
| 24 | ]; |
||
| 25 | |||
| 26 | 1 | if ($query->isCountTotal()) { |
|
| 27 | 1 | $meta['total'] = $this->count($query->getWhere() ?? []); |
|
|
|
|||
| 28 | } |
||
| 29 | } |
||
| 30 | |||
| 31 | 2 | return $meta ?? null; |
|
| 32 | } |
||
| 34 |