Completed
Push — master ( 2edeb4...8f93c5 )
by Albert
03:04
created

Paginator::getPerPage()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 4
ccs 2
cts 2
cp 1
rs 10
cc 1
eloc 2
nc 1
nop 0
crap 1
1
<?php
2
3
namespace Albert221\Blog\Pagination;
4
5
class Paginator
6
{
7
    private $page;
8
    
9
    private $perPage;
10
    
11
    private $pages;
12
    
13
    private $twig;
14
    
15 6
    public function __construct($page, $perPage, $pages, \Twig_Environment $twig)
16
    {
17 6
        $this->page = $page;
18 6
        $this->perPage = $perPage;
19 6
        $this->pages = $pages;
20 6
        $this->twig = $twig;
21 6
    }
22
23 3
    public function render()
24
    {
25 3
        return $this->twig->render('components/pagination.twig', [
26 3
            'currentPage' => $this->page,
27 3
            'perPage' => $this->perPage,
28 3
            'pages' => $this->pages
29 3
        ]);
30
    }
31
32 3
    public function getPage()
33
    {
34 3
        return $this->page;
35
    }
36
37 3
    public function getPerPage()
38
    {
39 3
        return $this->perPage;
40
    }
41
}
42