GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.

Pagination::__invoke()   A
last analyzed

Complexity

Conditions 3
Paths 2

Size

Total Lines 10

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 5
CRAP Score 3

Importance

Changes 0
Metric Value
dl 0
loc 10
ccs 5
cts 5
cp 1
rs 9.9332
c 0
b 0
f 0
cc 3
nc 2
nop 4
crap 3
1
<?php declare(strict_types=1);
2
/**
3
 * Starlit App.
4
 *
5
 * @copyright Copyright (c) 2016 Starweb AB
6
 * @license   BSD 3-Clause
7
 */
8
9
namespace Starlit\App\ViewHelper;
10
11
use Starlit\Paginator\Paginator;
12
13
class Pagination extends AbstractViewHelper
14
{
15 2
    public function __invoke(int $currentPageNo, int $rowsPerPage, int $totalRowCount, array $options = []): string
16
    {
17 2
        if (!$this->view || !$this->view->getRequest()) {
18 1
            throw new \LogicException('View request is required for this view helper');
19
        }
20
21 1
        $paginator = new Paginator($currentPageNo, $rowsPerPage, $totalRowCount, $this->view->getRequest(), $options);
0 ignored issues
show
Documentation introduced by
$this->view->getRequest() is of type object<Symfony\Component\HttpFoundation\Request>, but the function expects a callable.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
22
23 1
        return $paginator->getHtml();
24
    }
25
}
26