Passed
Pull Request — master (#8)
by Laurens
02:24
created

KvkResponse::getPreviousUrl()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 4
ccs 2
cts 2
cp 1
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 0
crap 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Werkspot\KvkApi\Api;
6
7
use Werkspot\KvkApi\Api\Profile\Company as ProfileCompany;
8
9
final class KvkResponse implements ResponseInterface
10
{
11
    private $itemsPerPage;
12
    private $startPage;
13
    private $totalItems;
14
    private $items;
15
    private $nextUrl;
16
    private $previousUrl;
17
18 20
    public function __construct(
19
        int $itemsPerPage,
20
        int $startPage,
21
        int $totalItems,
22
        array $items,
23
        ?string $nextLink = null,
24
        ?string $previousLink = null
25
    ) {
26 20
        $this->itemsPerPage = $itemsPerPage;
27 20
        $this->startPage = $startPage;
28 20
        $this->totalItems = $totalItems;
29 20
        $this->items = $items;
30 20
        $this->nextUrl = $nextLink;
31 20
        $this->previousUrl = $previousLink;
32 20
    }
33
34 1
    public function getItemsPerPage(): int
35
    {
36 1
        return $this->itemsPerPage;
37
    }
38
39 1
    public function getStartPage(): int
40
    {
41 1
        return $this->startPage;
42
    }
43
44 1
    public function getTotalItems(): int
45
    {
46 1
        return $this->totalItems;
47
    }
48
49
    /**
50
     * @return ProfileCompany[]
51
     */
52 16
    public function getItems(): array
53
    {
54 16
        return $this->items;
55
    }
56
57 2
    public function getNextUrl(): ?string
58
    {
59 2
        return $this->nextUrl;
60
    }
61
62 2
    public function getPreviousUrl(): ?string
63
    {
64 2
        return $this->previousUrl;
65
    }
66
}
67