PaginateOperation::setPageSize()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 5
ccs 0
cts 3
cp 0
rs 9.4285
c 0
b 0
f 0
nc 1
cc 1
eloc 3
nop 1
crap 2
1
<?php
2
namespace ViewComponents\ViewComponents\Data\Operation;
3
4
namespace Nayjest\Querying\Operation;
5
6
/**
7
 * DataProvider pagination operation.
8
 */
9
class PaginateOperation implements OperationInterface
10
{
11
    protected $pageNumber;
12
13
    protected $pageSize;
14
15
    /**
16
     * Constructor.
17
     *
18
     * @param int $pageNumber
19
     * @param int $pageSize
20
     */
21 3
    public function __construct($pageNumber = 1, $pageSize = 50)
22
    {
23 3
        $this->pageNumber = $pageNumber;
24 3
        $this->pageSize = $pageSize;
25 3
    }
26
27
    /**
28
     * @return int
29
     */
30 3
    public function getPageNumber()
31
    {
32 3
        return $this->pageNumber;
33
    }
34
35
    /**
36
     * @param int $pageNumber
37
     * @return $this
38
     */
39
    public function setPageNumber($pageNumber)
40
    {
41
        $this->pageNumber = $pageNumber;
42
        return $this;
43
    }
44
45
    /**
46
     * Returns page size.
47
     * @return int
48
     */
49 3
    public function getPageSize()
50
    {
51 3
        return $this->pageSize;
52
    }
53
54
    /**
55
     * Sets page size.
56
     *
57
     * @param $pageSize
58
     * @return $this
59
     */
60
    public function setPageSize($pageSize)
61
    {
62
        $this->pageSize = $pageSize;
63
        return $this;
64
    }
65
}
66