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.

Url::__invoke()   A
last analyzed

Complexity

Conditions 4
Paths 2

Size

Total Lines 11

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 6
CRAP Score 4

Importance

Changes 0
Metric Value
dl 0
loc 11
ccs 6
cts 6
cp 1
rs 9.9
c 0
b 0
f 0
cc 4
nc 2
nop 3
crap 4
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
class Url extends AbstractViewHelper
12
{
13 3
    public function __invoke(string $relativeUrl = null, array $parameters = [], string $argSeparator = '&amp;'): string
14
    {
15 3
        if (!$this->view || !($request = $this->view->getRequest())) {
16 1
            throw new \LogicException('View request is required for this view helper');
17
        }
18
19 2
        $url = new \Starlit\Utils\Url($relativeUrl ?: $request->getRequestUri());
20 2
        $url->addQueryParameters($parameters, true, $argSeparator);
21
22 2
        return (string) $url;
23
    }
24
}
25