Page::size()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 4
rs 10
cc 1
eloc 2
nc 1
nop 0
1
<?php
2
/**
3
 * Author: Nil Portugués Calderó <[email protected]>
4
 * Date: 12/14/15
5
 * Time: 7:52 PM.
6
 *
7
 * For the full copyright and license information, please view the LICENSE
8
 * file that was distributed with this source code.
9
 */
10
namespace NilPortugues\Api\JsonApi\Http\Request\Parameters;
11
12
/**
13
 * Class Page.
14
 */
15
class Page
16
{
17
    /**
18
     * @var string|int|null
19
     */
20
    protected $number;
21
    /**
22
     * @var string|int|null
23
     */
24
    protected $cursor;
25
    /**
26
     * @var string|int|null
27
     */
28
    protected $limit;
29
    /**
30
     * @var string|int|null
31
     */
32
    protected $offset;
33
    /**
34
     * @var string|int|null
35
     */
36
    protected $size;
37
38
    /**
39
     * @param $number
40
     * @param $cursor
41
     * @param $limit
42
     * @param $offset
43
     * @param $size
44
     */
45
    public function __construct($number, $cursor, $limit, $offset, $size)
46
    {
47
        $this->number = $number;
48
        $this->cursor = $cursor;
49
        $this->limit = $limit;
50
        $this->offset = $offset;
51
        $this->size = $size;
52
    }
53
54
    /**
55
     * @param $size
56
     */
57
    public function setSize($size)
58
    {
59
        $this->size = (int) $size;
60
    }
61
62
    /**
63
     * @return int|string
64
     */
65
    public function cursor()
66
    {
67
        return $this->cursor;
68
    }
69
70
    /**
71
     * @return int|string
72
     */
73
    public function limit()
74
    {
75
        return $this->limit;
76
    }
77
78
    /**
79
     * @return int|string
80
     */
81
    public function number()
82
    {
83
        return $this->number;
84
    }
85
86
    /**
87
     * @return int|string
88
     */
89
    public function offset()
90
    {
91
        return $this->offset;
92
    }
93
94
    /**
95
     * @return int|string
96
     */
97
    public function size()
98
    {
99
        return $this->size;
100
    }
101
}
102