FindResponse   A
last analyzed

Complexity

Total Complexity 11

Size/Duplication

Total Lines 137
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
eloc 23
dl 0
loc 137
ccs 28
cts 28
cp 1
rs 10
c 0
b 0
f 0
wmc 11

11 Methods

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