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.
Passed
Push — master ( 277531...da2303 )
by Toby
06:21 queued 02:58
created

SpatieUrlManipulator::appendQuery()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 2

Importance

Changes 0
Metric Value
eloc 2
dl 0
loc 4
ccs 3
cts 3
cp 1
rs 10
c 0
b 0
f 0
cc 2
nc 2
nop 1
crap 2
1
<?php
2
3
namespace Linkeys\UrlSigner\Support\UrlManipulator;
4
5
use Linkeys\UrlSigner\Support\UrlManipulator\UrlManipulator as UrlManipulatorContract;
6
use Spatie\Url\Url;
7
8
class SpatieUrlManipulator implements UrlManipulatorContract
9
{
10
11
    /**
12
     * @var Url
13
     */
14
    protected $url;
15
16 10
    public function setUrl(string $url)
17
    {
18 10
        $this->url = Url::fromString($url);
19 10
    }
20
21
    /**
22
     * @return mixed
23
     */
24 7
    public function getUrl()
25
    {
26 7
        return (string) $this->url;
27
    }
28
29 4
    public function appendQuery(array $newQuery)
30
    {
31 4
        foreach($newQuery as $key => $value) {
32 4
            $this->url = $this->url->withQueryParameter($key, $value);
33
        }
34 4
    }
35
36
37 3
    public function removeQuery($key)
38
    {
39 3
        $this->url = $this->url->withoutQueryParameter($key);
40 3
    }
41
42 3
    public function getQuery() : ?array
43
    {
44 3
        return $this->url->getAllQueryParameters();
45
    }
46
47
}