Test Setup Failed
Push — master ( 8eb8d2...671183 )
by Churakov
04:26 queued 12s
created

PaginationHelper::getNextUrl()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
cc 1
eloc 1
nc 1
nop 0
dl 0
loc 4
rs 10
c 1
b 0
f 1
1
<?php
2
3
namespace ChurakovMike\EasyGrid\Helpers;
4
5
use Illuminate\Pagination\LengthAwarePaginator;
6
7
/**
8
 * Class PaginationHelper
9
 * @package ChurakovMike\EasyGrid\Helpers
10
 *
11
 * @property LengthAwarePaginator $paginator
12
 */
13
class PaginationHelper
14
{
15
    /**
16
     * @var LengthAwarePaginator $paginator
17
     */
18
    public $paginator;
19
20
    /**
21
     * PaginationHelper constructor.
22
     * @param LengthAwarePaginator $paginator
23
     */
24
    public function __construct(LengthAwarePaginator $paginator)
25
    {
26
        $this->paginator = $paginator;
27
    }
28
29
    /**
30
     * Build next page link with sort and filters.
31
     *
32
     * @return string
33
     */
34
    public function getNextUrl(): string
35
    {
36
        //TODO: доделать подстановку параметров
37
        return url()->current() . '/?page=' .  ($this->paginator->currentPage() - 1);
38
    }
39
}
40