PagerUriManagerInterface::getCurrentPageSize()
last analyzed

Size

Total Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 1
c 0
b 0
f 0
1
<?php
2
3
namespace BenTools\OpenCubes\Component\Pager;
4
5
use Psr\Http\Message\UriInterface;
6
7
interface PagerUriManagerInterface
8
{
9
10
    /**
11
     * Extract the current page size from the given Uri.
12
     *
13
     * @param UriInterface $uri
14
     * @return int|null
15
     */
16
    public function getCurrentPageSize(UriInterface $uri): ?int;
17
18
    /**
19
     * Extract the current page number from the given Uri.
20
     *
21
     * @param UriInterface $uri
22
     * @return int|null
23
     */
24
    public function getCurrentPageNumber(UriInterface $uri): ?int;
25
26
    /**
27
     * Build an Uri with the given page number.
28
     *
29
     * @param UriInterface $uri
30
     * @param int          $pageNumber
31
     * @param bool|null    $paginationEnabled
0 ignored issues
show
Bug introduced by
There is no parameter named $paginationEnabled. Was it maybe removed?

This check looks for PHPDoc comments describing methods or function parameters that do not exist on the corresponding method or function.

Consider the following example. The parameter $italy is not defined by the method finale(...).

/**
 * @param array $germany
 * @param array $island
 * @param array $italy
 */
function finale($germany, $island) {
    return "2:1";
}

The most likely cause is that the parameter was removed, but the annotation was not.

Loading history...
32
     * @return UriInterface
33
     * @throws \InvalidArgumentException
34
     */
35
    public function buildPageUri(UriInterface $uri, int $pageNumber): UriInterface;
36
37
    /**
38
     * Build an Uri with the given page size.
39
     * When $size is null, the Uri should no longer carry this value.
40
     *
41
     * @param UriInterface $uri
42
     * @param int          $size
43
     * @return UriInterface
44
     * @throws \InvalidArgumentException
45
     * @throws \Symfony\Component\OptionsResolver\Exception\NoSuchOptionException
46
     */
47
    public function buildSizeUri(UriInterface $uri, ?int $size): UriInterface;
48
}
49