Completed
Push — master ( a98e5a...279cc6 )
by Javier
02:44
created

Pager::getPage()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
1
<?php
2
3
declare(strict_types=1);
4
5
/*
6
 * This file is part of the Sonata Project package.
7
 *
8
 * (c) Thomas Rabaix <[email protected]>
9
 *
10
 * For the full copyright and license information, please view the LICENSE
11
 * file that was distributed with this source code.
12
 */
13
14
namespace Sonata\AdminBundle\Tests\App\Datagrid;
15
16
use Sonata\AdminBundle\Datagrid\PagerInterface;
17
use Sonata\AdminBundle\Datagrid\ProxyQueryInterface;
18
use Sonata\AdminBundle\Tests\App\Model\FooRepository;
19
20
final class Pager implements PagerInterface
21
{
22
    /**
23
     * @var FooRepository
24
     */
25
    private $repository;
26
27
    public function __construct(FooRepository $repository)
28
    {
29
        $this->repository = $repository;
30
    }
31
32
    public function init(): void
33
    {
34
    }
35
36
    public function getMaxPerPage(): int
37
    {
38
        return 1;
39
    }
40
41
    public function setMaxPerPage($max): void
42
    {
43
    }
44
45
    public function getPage(): int
46
    {
47
        return 1;
48
    }
49
50
    public function setPage($page): void
51
    {
52
    }
53
54
    public function setQuery(ProxyQueryInterface $query): void
55
    {
56
    }
57
58
    public function isLastPage(): bool
59
    {
60
        return false;
61
    }
62
63
    public function getNbResults(): int
64
    {
65
        return 10;
66
    }
67
68
    public function getResults(): array
69
    {
70
        return $this->repository->all();
71
    }
72
73
    public function setMaxPageLinks(int $maxPageLinks): void
74
    {
75
    }
76
77
    public function getMaxPageLinks(): int
78
    {
79
        return 1;
80
    }
81
}
82