Passed
Push — master ( 727475...c2e18b )
by Igor
04:07
created

FindResponse::setTotalPage()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 1

Importance

Changes 0
Metric Value
cc 1
eloc 2
nc 1
nop 1
dl 0
loc 5
ccs 3
cts 3
cp 1
crap 1
rs 10
c 0
b 0
f 0
1
<?php
2
3
namespace SomeWork\Minjust;
4
5
use Generator;
6
use SomeWork\Minjust\Entity\DetailLawyer;
7
use SomeWork\Minjust\Entity\Lawyer;
8
9
/**
10
 * @see \SomeWork\Minjust\Tests\Unit\FindResponseTest
11
 */
12
class FindResponse
13
{
14
    /**
15
     * @var Lawyer[]
16
     */
17
    protected $lawyers = [];
18
19
    /**
20
     * @var Generator|DetailLawyer[]
21
     */
22
    protected $detailLawyers;
23
24
    /**
25
     * @var int
26
     */
27
    protected $page = 1;
28
29
    /**
30
     * @var int
31
     */
32
    protected $totalPage = 1;
33
34
    /**
35
     * @var int
36
     */
37
    protected $total = 0;
38
39
    /**
40
     * @return array
41
     */
42 1
    public function getLawyers(): array
43
    {
44 1
        return $this->lawyers;
45
    }
46
47
    /**
48
     * @param array $lawyers
49
     *
50
     * @return FindResponse
51
     */
52 1
    public function setLawyers(array $lawyers): FindResponse
53
    {
54 1
        $this->lawyers = $lawyers;
55
56 1
        return $this;
57
    }
58
59
    /**
60
     * @return int
61
     */
62 1
    public function getPage(): int
63
    {
64 1
        return $this->page;
65
    }
66
67
    /**
68
     * @param int $page
69
     *
70
     * @return FindResponse
71
     */
72 1
    public function setPage(int $page): FindResponse
73
    {
74 1
        $this->page = $page;
75
76 1
        return $this;
77
    }
78
79
    /**
80
     * @return int
81
     */
82 1
    public function getTotalPage(): int
83
    {
84 1
        return $this->totalPage;
85
    }
86
87
    /**
88
     * @param int $totalPage
89
     *
90
     * @return FindResponse
91
     */
92 1
    public function setTotalPage(int $totalPage): FindResponse
93
    {
94 1
        $this->totalPage = $totalPage;
95
96 1
        return $this;
97
    }
98
99
    /**
100
     * @return int
101
     */
102 1
    public function getTotal(): int
103
    {
104 1
        return $this->total;
105
    }
106
107
    /**
108
     * @param int $total
109
     *
110
     * @return FindResponse
111
     */
112 1
    public function setTotal(int $total): FindResponse
113
    {
114 1
        $this->total = $total;
115
116 1
        return $this;
117
    }
118
119
    /**
120
     * @param \SomeWork\Minjust\Entity\Lawyer $lawyer
121
     *
122
     * @return FindResponse
123
     */
124 1
    public function addLawyer(Lawyer $lawyer): self
125
    {
126 1
        $this->lawyers[] = $lawyer;
127
128 1
        return $this;
129
    }
130
131
    /**
132
     * @return Generator|DetailLawyer[]
133
     */
134 1
    public function getDetailLawyers()
135
    {
136 1
        return $this->detailLawyers;
137
    }
138
139
    /**
140
     * @param Generator|DetailLawyer[] $detailLawyers
141
     *
142
     * @return static
143
     */
144 1
    public function setDetailLawyersGenerator(Generator $detailLawyers): self
145
    {
146 1
        $this->detailLawyers = $detailLawyers;
147
148 1
        return $this;
149
    }
150
}
151