LengthAwarePaginator::__construct()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 13
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 2
eloc 5
c 1
b 0
f 0
nc 2
nop 5
dl 0
loc 13
rs 10
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