Code Duplication    Length = 12-12 lines in 2 locations

source/Spiral/Pagination/CountingPaginator.php 1 location

@@ 54-65 (lines=12) @@
51
    /**
52
     * {@inheritdoc}
53
     */
54
    public function getPage()
55
    {
56
        if ($this->pageNumber < 1) {
57
            return 1;
58
        }
59
60
        if ($this->pageNumber > $this->countPages) {
61
            return $this->countPages;
62
        }
63
64
        return $this->pageNumber;
65
    }
66
67
    /**
68
     * {@inheritdoc}

source/Spiral/Pagination/Paginator.php 1 location

@@ 221-232 (lines=12) @@
218
    /**
219
     * {@inheritdoc}
220
     */
221
    public function getPage()
222
    {
223
        if ($this->pageNumber < 1) {
224
            return 1;
225
        }
226
227
        if ($this->pageNumber > $this->countPages) {
228
            return $this->countPages;
229
        }
230
231
        return $this->pageNumber;
232
    }
233
234
    /**
235
     * Get pagination offset.