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.

HandleLarsign::handle()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 10
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 2.0625

Importance

Changes 0
Metric Value
dl 0
loc 10
ccs 3
cts 4
cp 0.75
rs 9.4285
c 0
b 0
f 0
cc 2
eloc 4
nc 2
nop 2
crap 2.0625
1
<?php
2
3
namespace HavenShen\Larsign;
4
5
use Closure;
6
use Larsign;
7
use Illuminate\Http\Response as LaravelResponse;
8
9
/**
10
 * HandleLarsign
11
 *
12
 * @author    Haven Shen <[email protected]>
13
 * @copyright    Copyright (c) Haven Shen
14
 */
15
class HandleLarsign
16
{
17
    /**
18
     * Handle an incoming request.
19
     *
20
     * @param  \Illuminate\Http\Request  $request
21
     * @param  \Closure  $next
22
     * @return mixed
23
     */
24 2
    public function handle($request, Closure $next)
25
    {
26
27 2
        if (! Larsign::check($request)) {
28
            return new LaravelResponse('Not allowed.', 403);
29
            // throw new LarsignException();
0 ignored issues
show
Unused Code Comprehensibility introduced by
56% of this comment could be valid code. Did you maybe forget this after debugging?

Sometimes obsolete code just ends up commented out instead of removed. In this case it is better to remove the code once you have checked you do not need it.

The code might also have been commented out for debugging purposes. In this case it is vital that someone uncomments it again or your project may behave in very unexpected ways in production.

This check looks for comments that seem to be mostly valid code and reports them.

Loading history...
30
        }
31
32 2
        return $next($request);
33
    }
34
}