GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.

IlluminatePaginatorAdapter   A
last analyzed

Complexity

Total Complexity 8

Size/Duplication

Total Lines 93
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 8
c 1
b 0
f 0
lcom 1
cbo 1
dl 0
loc 93
ccs 17
cts 17
cp 1
rs 10

8 Methods

Rating   Name   Duplication   Size   Complexity  
A getCurrentPage() 0 4 1
A getUrl() 0 4 1
A getPaginator() 0 4 1
A __construct() 0 4 1
A getLastPage() 0 4 1
A getTotal() 0 4 1
A getCount() 0 4 1
A getPerPage() 0 4 1
1
<?php
2
3
/*
4
 * This file is part of the League\Fractal package.
5
 *
6
 * (c) Phil Sturgeon <[email protected]>
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
12
namespace League\Fractal\Pagination;
13
14
use Illuminate\Contracts\Pagination\LengthAwarePaginator;
15
16
/**
17
 * A paginator adapter for illuminate/pagination.
18
 *
19
 * @author Maxime Beaudoin <[email protected]>
20
 * @author Marc Addeo <[email protected]>
21
 */
22
class IlluminatePaginatorAdapter implements PaginatorInterface
23
{
24
    /**
25
     * The paginator instance.
26
     *
27
     * @var \Illuminate\Contracts\Pagination\LengthAwarePaginator
28
     */
29
    protected $paginator;
30
31
    /**
32
     * Create a new illuminate pagination adapter.
33
     *
34
     * @param \Illuminate\Contracts\Pagination\LengthAwarePaginator $paginator
35
     *
36
     * @return void
37
     */
38 1
    public function __construct(LengthAwarePaginator $paginator)
39
    {
40 1
        $this->paginator = $paginator;
41 1
    }
42
43
    /**
44
     * Get the current page.
45
     *
46
     * @return int
47
     */
48 1
    public function getCurrentPage()
49
    {
50 1
        return $this->paginator->currentPage();
51
    }
52
53
    /**
54
     * Get the last page.
55
     *
56
     * @return int
57
     */
58 1
    public function getLastPage()
59
    {
60 1
        return $this->paginator->lastPage();
61
    }
62
63
    /**
64
     * Get the total.
65
     *
66
     * @return int
67
     */
68 1
    public function getTotal()
69
    {
70 1
        return $this->paginator->total();
71
    }
72
73
    /**
74
     * Get the count.
75
     *
76
     * @return int
77
     */
78 1
    public function getCount()
79
    {
80 1
        return $this->paginator->count();
81
    }
82
83
    /**
84
     * Get the number per page.
85
     *
86
     * @return int
87
     */
88 1
    public function getPerPage()
89
    {
90 1
        return $this->paginator->perPage();
91
    }
92
93
    /**
94
     * Get the url for the given page.
95
     *
96
     * @param int $page
97
     *
98
     * @return string
99
     */
100 1
    public function getUrl($page)
101
    {
102 1
        return $this->paginator->url($page);
103
    }
104
105
    /**
106
     * Get the paginator instance.
107
     *
108
     * @return \Illuminate\Contracts\Pagination\LengthAwarePaginator
109
     */
110 1
    public function getPaginator()
111
    {
112 1
        return $this->paginator;
113
    }
114
}
115