Completed
Push — master ( 57b7f2...4f95ff )
by Grégoire
28:13 queued 01:46
created

Pager::getNbResults()   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\Tests\App\Model\FooRepository;
18
19
final class Pager implements PagerInterface
20
{
21
    /**
22
     * @var FooRepository
23
     */
24
    private $repository;
25
26
    public function __construct(FooRepository $repository)
27
    {
28
        $this->repository = $repository;
29
    }
30
31
    public function init(): void
32
    {
33
    }
34
35
    public function getMaxPerPage()
36
    {
37
        return 1;
38
    }
39
40
    public function setMaxPerPage($max): void
41
    {
42
    }
43
44
    public function setPage($page): void
45
    {
46
    }
47
48
    public function setQuery($query): void
49
    {
50
    }
51
52
    public function isLastPage(): bool
53
    {
54
        return false;
55
    }
56
57
    public function getNbResults(): int
58
    {
59
        return 10;
60
    }
61
62
    public function getResults(): array
63
    {
64
        return $this->repository->all();
65
    }
66
67
    public function setMaxPageLinks($maxPageLinks): void
68
    {
69
    }
70
71
    public function getMaxPageLinks()
72
    {
73
        return 1;
74
    }
75
}
76