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.

PageFactory::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
cc 1
eloc 1
c 1
b 0
f 1
nc 1
nop 1
dl 0
loc 3
rs 10
1
<?php
2
declare(strict_types=1);
3
/**
4
 */
5
6
namespace CommerceLeague\ActiveCampaignApi\Paginator;
7
8
use CommerceLeague\ActiveCampaignApi\Api\Operation\ListableResourceInterface;
9
use CommerceLeague\ActiveCampaignApi\Client\HttpClientInterface;
10
11
/**
12
 * Class PageFactory
13
 */
14
class PageFactory implements PageFactoryInterface
15
{
16
    /**
17
     * @var HttpClientInterface
18
     */
19
    private $httpClient;
20
21
    /**
22
     * @param HttpClientInterface $httpClient
23
     */
24
    public function __construct(HttpClientInterface $httpClient)
25
    {
26
        $this->httpClient = $httpClient;
27
    }
28
29
    /**
30
     * @inheritDoc
31
     */
32
    public function createPage(
33
        ListableResourceInterface $listableResource,
34
        array $item,
35
        array $meta
36
    ): PageInterface {
37
        $totalCount = (int)$meta['total'];
38
        $limit = isset($meta['page_input']) ? (int)$meta['page_input']['limit'] : null;
39
        $offset = isset($meta['page_input']) ? (int)$meta['page_input']['offset']: null;
40
41
        return new Page(
42
            new PageFactory($this->httpClient),
43
            $this->httpClient,
44
            $listableResource,
45
            $totalCount,
46
            $limit,
47
            $offset,
48
            $item
49
        );
50
    }
51
}
52