Completed
Push — master ( 4e4cd8...063296 )
by Maksim
16s
created

PagerfantaPager::getNbPages()   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 0
Metric Value
dl 0
loc 4
ccs 2
cts 2
cp 1
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 0
crap 1
1
<?php
2
namespace FOS\ElasticaBundle\Provider;
3
4
use Pagerfanta\Pagerfanta;
5
6
class PagerfantaPager implements PagerInterface
7
{
8
    /**
9
     * @var Pagerfanta
10
     */
11
    private $pagerfanta;
12
13 13
    public function __construct(Pagerfanta $pagerfanta)
14
    {
15 13
        $this->pagerfanta = $pagerfanta;
16 13
    }
17
18
    /**
19
     * {@inheritdoc}
20
     */
21
    public function getNbResults()
22
    {
23
        return $this->pagerfanta->getNbResults(); 
24
    }
25
26
    /**
27
     * {@inheritdoc}
28
     */
29 8
    public function getNbPages()
30
    {
31 8
        return $this->pagerfanta->getNbPages();
32
    }
33
34
    /**
35
     * {@inheritdoc}
36
     */
37 8
    public function getCurrentPage()
38
    {
39 8
        return $this->pagerfanta->getCurrentPage();
40
    }
41
42
    /**
43
     * {@inheritdoc}
44
     */
45 8
    public function setCurrentPage($page)
46
    {
47 8
        $this->pagerfanta->setCurrentPage($page);
48 8
    }
49
50
    /**
51
     * {@inheritdoc}
52
     */
53
    public function getMaxPerPage()
54
    {
55
        return $this->pagerfanta->getMaxPerPage();
56
    }
57
58
    /**
59
     * {@inheritdoc}
60
     */
61 8
    public function setMaxPerPage($perPage)
62
    {
63 8
        $this->pagerfanta->setMaxPerPage($perPage);
64 8
    }
65
66
    /**
67
     * {@inheritdoc}
68
     */
69 8
    public function getCurrentPageResults()
70
    {
71 8
        return $this->pagerfanta->getCurrentPageResults();
0 ignored issues
show
Bug Compatibility introduced by
The expression $this->pagerfanta->getCurrentPageResults(); of type array|Traversable adds the type Traversable to the return on line 71 which is incompatible with the return type declared by the interface FOS\ElasticaBundle\Provi...::getCurrentPageResults of type array.
Loading history...
72
    }
73
74
    /**
75
     * @return Pagerfanta
76
     */
77 3
    public function getPagerfanta()
78
    {
79 3
        return $this->pagerfanta;
80
    }
81
}
82