Passed
Push — master ( 9e1161...5545f1 )
by Kirill
03:21
created
src/Pagination/src/Paginator.php 1 patch
Braces   +17 added lines, -8 removed lines patch added patch discarded remove patch
@@ -103,11 +103,13 @@  discard block
 block discarded – undo
103 103
      */
104 104
     public function getPage(): int
105 105
     {
106
-        if ($this->pageNumber < 1) {
106
+        if ($this->pageNumber < 1)
107
+        {
107 108
             return 1;
108 109
         }
109 110
 
110
-        if ($this->pageNumber > $this->countPages) {
111
+        if ($this->pageNumber > $this->countPages)
112
+        {
111 113
             return $this->countPages;
112 114
         }
113 115
 
@@ -128,7 +130,8 @@  discard block
 block discarded – undo
128 130
     public function paginate(PaginableInterface $target): PaginatorInterface
129 131
     {
130 132
         $paginator = clone $this;
131
-        if ($target instanceof \Countable && $paginator->count === 0) {
133
+        if ($target instanceof \Countable && $paginator->count === 0)
134
+        {
132 135
             $paginator->setCount($target->count());
133 136
         }
134 137
 
@@ -159,7 +162,8 @@  discard block
 block discarded – undo
159 162
      */
160 163
     public function countDisplayed(): int
161 164
     {
162
-        if ($this->getPage() == $this->countPages) {
165
+        if ($this->getPage() == $this->countPages)
166
+        {
163 167
             return $this->count - $this->getOffset();
164 168
         }
165 169
 
@@ -179,7 +183,8 @@  discard block
 block discarded – undo
179 183
      */
180 184
     public function nextPage()
181 185
     {
182
-        if ($this->getPage() != $this->countPages) {
186
+        if ($this->getPage() != $this->countPages)
187
+        {
183 188
             return $this->getPage() + 1;
184 189
         }
185 190
 
@@ -191,7 +196,8 @@  discard block
 block discarded – undo
191 196
      */
192 197
     public function previousPage()
193 198
     {
194
-        if ($this->getPage() > 1) {
199
+        if ($this->getPage() > 1)
200
+        {
195 201
             return $this->getPage() - 1;
196 202
         }
197 203
 
@@ -208,9 +214,12 @@  discard block
 block discarded – undo
208 214
     private function setCount(int $count): self
209 215
     {
210 216
         $this->count = max($count, 0);
211
-        if ($this->count > 0) {
217
+        if ($this->count > 0)
218
+        {
212 219
             $this->countPages = (int)ceil($this->count / $this->limit);
213
-        } else {
220
+        }
221
+        else
222
+        {
214 223
             $this->countPages = 1;
215 224
         }
216 225
 
Please login to merge, or discard this patch.