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.

Router   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 27
Duplicated Lines 0 %

Test Coverage

Coverage 91.67%

Importance

Changes 0
Metric Value
wmc 4
eloc 16
dl 0
loc 27
ccs 11
cts 12
cp 0.9167
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A createRouter() 0 25 4
1
<?php
2
3
namespace Mado\QueryBundle\Services;
4
5
use Hateoas\Configuration\Route;
6
use Mado\QueryBundle\Queries\QueryBuilderOptions;
7
8
class Router
9
{
10 2
    public function createRouter(QueryBuilderOptions $queryOptions, $routeName) :Route
11
    {
12 2
        $params = [];
13 2
        $routeParams = [];
14
15 2
        if (null != $queryOptions->get('_route_params')) {
16 1
            $routeParams = array_keys($queryOptions->get('_route_params'));
0 ignored issues
show
Bug introduced by
It seems like $queryOptions->get('_route_params') can also be of type null; however, parameter $input of array_keys() does only seem to accept array, maybe add an additional type check? ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-type  annotation

16
            $routeParams = array_keys(/** @scrutinizer ignore-type */ $queryOptions->get('_route_params'));
Loading history...
17
        }
18
19 2
        $list = array_merge([
20 2
            'filtering',
21
            'limit',
22
            'page',
23
            'sorting',
24
        ], $routeParams);
25
26 2
        foreach ($list as $itemKey => $itemValue) {
27 2
            $params[$itemValue] = $queryOptions->get($itemValue);
28
        }
29
30 2
        if (!isset($routeName)) {
31
            $routeName = $queryOptions->get('_route');
32
        }
33
34 2
        return new Route($routeName, $params);
35
    }
36
}