PaginationParameterBag::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 4
nc 1
nop 4
dl 0
loc 6
rs 10
c 0
b 0
f 0
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Setono\SyliusPaginationPlugin\ParameterBag;
6
7
use Symfony\Component\HttpFoundation\Request;
8
9
final class PaginationParameterBag
10
{
11
    /**
12
     * @var Request
13
     */
14
    private $request;
15
16
    /**
17
     * @var int
18
     */
19
    private $numberOfResults;
20
21
    /**
22
     * @var int
23
     */
24
    private $maxPerPage;
25
26
    /**
27
     * @var int
28
     */
29
    private $currentPage;
30
31
    public function __construct(Request $request, int $numberOfResults, int $maxPerPage, int $currentPage)
32
    {
33
        $this->request = $request;
34
        $this->numberOfResults = $numberOfResults;
35
        $this->maxPerPage = $maxPerPage;
36
        $this->currentPage = $currentPage;
37
    }
38
39
    public function getRequest(): Request
40
    {
41
        return $this->request;
42
    }
43
44
    public function getNumberOfResults(): int
45
    {
46
        return $this->numberOfResults;
47
    }
48
49
    public function getMaxPerPage(): int
50
    {
51
        return $this->maxPerPage;
52
    }
53
54
    public function getCurrentPage(): int
55
    {
56
        return $this->currentPage;
57
    }
58
}
59