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

CheckLinkUnchanged::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
eloc 1
dl 0
loc 4
ccs 2
cts 2
cp 1
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 1
crap 1
1
<?php
2
3
4
namespace Linkeys\UrlSigner\Middleware;
5
6
7
use Closure;
8
use Illuminate\Database\Eloquent\ModelNotFoundException;
9
use Linkeys\UrlSigner\Contracts\Models\Link;
10
use Linkeys\UrlSigner\Exceptions\LinkNotFoundException;
11
use Linkeys\UrlSigner\Support\LinkRepository\LinkRepository;
12
use Linkeys\UrlSigner\Support\UrlManipulator\UrlManipulator;
13
use Symfony\Component\HttpFoundation\Request;
14
15
class CheckLinkUnchanged
16
{
17
18
    /**
19
     * @var UrlManipulator
20
     */
21
    private $urlManipulator;
22
23 2
    public function __construct(UrlManipulator $urlManipulator)
24
    {
25
26 2
        $this->urlManipulator = $urlManipulator;
27 2
    }
28
29 2
    public function handle(Request $request, Closure $next)
30
    {
31
32 2
        $link = $request->get('link');
33
34 2
        $this->urlManipulator->setUrl($request->getUri());
35 2
        $this->urlManipulator->removeQuery(config('links.query_key'));
36 2
        if($link->url !== $this->urlManipulator->getUrl()){
37 1
            throw new LinkNotFoundException;
38
        }
39 1
        return $next($request);
40
    }
41
}