LengthAwarePaginator   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 26
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 6
c 1
b 0
f 0
dl 0
loc 26
rs 10
wmc 2

1 Method

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 13 2
1
<?php
2
3
namespace Sulao\LRTS\Pagination;
4
5
use Sulao\LRTS\Helper;
6
7
class LengthAwarePaginator extends \Illuminate\Pagination\LengthAwarePaginator
8
{
9
    /**
10
     * Create a new paginator instance.
11
     *
12
     * @param mixed    $items
13
     * @param int      $total
14
     * @param int      $perPage
15
     * @param int|null $currentPage
16
     * @param array    $options     (path, query, fragment, pageName)
17
     *
18
     * @return void
19
     */
20
    public function __construct(
21
        $items,
22
        $total,
23
        $perPage,
24
        $currentPage = null,
25
        array $options = []
26
    ) {
27
        parent::__construct($items, $total, $perPage, $currentPage, $options);
28
29
        if (isset($options['path'])) {
30
            $this->path = Helper::appendSlashes(
31
                $this->path,
32
                $options['path']
33
            );
34
        }
35
    }
36
}
37