Completed
Pull Request — master (#1571)
by
unknown
10:12 queued 08:35
created

PagerfantaPager::getPagerfanta()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 4
ccs 0
cts 2
cp 0
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
crap 2
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 10
    public function getNbPages()
30
    {
31 10
        return $this->pagerfanta->getNbPages();
32
    }
33
34
    /**
35
     * {@inheritdoc}
36
     */
37 10
    public function getCurrentPage()
38
    {
39 10
        return $this->pagerfanta->getCurrentPage();
40
    }
41
42
    /**
43
     * {@inheritdoc}
44
     */
45 10
    public function setCurrentPage($page)
46
    {
47 10
        $this->pagerfanta->setCurrentPage($page);
48 10
    }
49
50
    /**
51
     * {@inheritdoc}
52
     */
53 10
    public function getMaxPerPage()
54
    {
55 10
        return $this->pagerfanta->getMaxPerPage();
56
    }
57
58
    /**
59
     * {@inheritdoc}
60
     */
61 10
    public function setMaxPerPage($perPage)
62
    {
63 10
        $this->pagerfanta->setMaxPerPage($perPage);
64 10
    }
65
66
    /**
67
     * {@inheritdoc}
68
     */
69 10
    public function getCurrentPageResults()
70
    {
71 10
        return $this->pagerfanta->getCurrentPageResults();
0 ignored issues
show
Bug Compatibility introduced by
The expression $this->pagerfanta->getCurrentPageResults(); of type Pagerfanta\iterable|null adds the type Pagerfanta\iterable 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
    public function getPagerfanta()
78
    {
79
        return $this->pagerfanta;
80
    }
81
}
82