GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.
Completed
Push — master ( b5dfb6...a568a9 )
by Mario
40:05
created

BaseAdapter::getQuery()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 8

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 8
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 2
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Netgen\InformationCollection\Core\Pagination;
6
7
use Netgen\InformationCollection\API\Service\InformationCollection;
8
use Netgen\InformationCollection\API\Value\Filter\Query;
9
use Pagerfanta\Adapter\AdapterInterface;
10
11
abstract class BaseAdapter implements AdapterInterface
12
{
13
    /**
14
     * @var \Netgen\InformationCollection\API\Service\InformationCollection
15
     */
16
    protected $informationCollectionService;
17
18
    /**
19
     * @var \Netgen\InformationCollection\API\Value\Filter\Query
20
     */
21
    protected $query;
22
23
    /**
24
     * InformationCollectionCollectionListAdapter constructor.
25
     *
26
     * @param \Netgen\InformationCollection\API\Service\InformationCollection $informationCollectionService
27
     * @param \Netgen\InformationCollection\API\Value\Filter\Query $query
28
     */
29
    public function __construct(InformationCollection $informationCollectionService, Query $query)
30
    {
31
        $this->informationCollectionService = $informationCollectionService;
32
        $this->query = $query;
33
    }
34
35
    /**
36
     * @param int $offset
37
     * @param int $length
38
     *
39
     * @return \Netgen\InformationCollection\API\Value\Filter\Query
40
     */
41
    protected function getQuery($offset, $length)
42
    {
43
        $query = clone $this->query;
44
        $query->limit = $length;
45
        $query->offset = $offset;
46
47
        return $query;
48
    }
49
50
    /**
51
     * @return \Netgen\InformationCollection\API\Value\Filter\Query
52
     */
53
    protected function getCountQuery()
54
    {
55
        $query = clone $this->query;
56
        $query->limit = Query::COUNT_QUERY;
57
58
        return $query;
59
    }
60
}
61