Total Complexity | 5 |
Total Lines | 55 |
Duplicated Lines | 0 % |
Changes | 2 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
13 | class QueryResult |
||
14 | { |
||
15 | /** |
||
16 | * @var object[]|object|null |
||
17 | */ |
||
18 | public $results; |
||
19 | |||
20 | /*** |
||
21 | * @var int|null |
||
22 | */ |
||
23 | public $count; |
||
24 | |||
25 | /*** |
||
26 | * @var bool|null |
||
27 | */ |
||
28 | public $hasMore; |
||
29 | |||
30 | /** |
||
31 | * QueryResult constructor. |
||
32 | * @param object|object[]|null $results |
||
33 | * @param int|null $count |
||
34 | * @param bool|null $hasMore |
||
35 | */ |
||
36 | public function __construct($results = null, ?int $count = null, ?bool $hasMore = null) |
||
37 | { |
||
38 | $this->results = $results; |
||
39 | $this->count = $count; |
||
40 | $this->hasMore = $hasMore; |
||
41 | } |
||
42 | |||
43 | /** |
||
44 | * @param int $count |
||
45 | * @param int|null $top |
||
46 | * @param int|null $skip |
||
47 | * |
||
48 | * @throws InvalidArgumentException if $count is not numeric |
||
49 | * @return int the paging adjusted count |
||
50 | */ |
||
51 | public static function adjustCountForPaging(int $count, ?int $top, ?int $skip) |
||
68 | } |
||
69 | } |
||
70 |