Completed
Push — master ( 8386c2...ffd2be )
by Simonas
61:26
created

CountAdapter   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 33
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

Changes 0
Metric Value
wmc 3
c 0
b 0
f 0
lcom 0
cbo 0
dl 0
loc 33
rs 10

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A getTotalResults() 0 4 1
A getResults() 0 4 1
1
<?php
2
3
/*
4
 * This file is part of the ONGR package.
5
 *
6
 * (c) NFQ Technologies UAB <[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 ONGR\FilterManagerBundle\Pager\Adapters;
13
14
use ONGR\FilterManagerBundle\Pager\PagerAdapterInterface;
15
16
/**
17
 * Adapter used to simply calculate offset for a given page.
18
 */
19
class CountAdapter implements PagerAdapterInterface
20
{
21
    /**
22
     * @var int
23
     */
24
    private $count;
25
26
    /**
27
     * Constructor.
28
     *
29
     * @param int $count
30
     */
31
    public function __construct($count)
32
    {
33
        $this->count = $count;
34
    }
35
36
    /**
37
     * {@inheritdoc}
38
     */
39
    public function getTotalResults()
40
    {
41
        return $this->count;
42
    }
43
44
    /**
45
     * {@inheritdoc}
46
     */
47
    public function getResults($offset, $limit)
48
    {
49
        return [];
50
    }
51
}
52