Completed
Push — master ( b8763b...0e0e56 )
by Pavel
05:40
created

Authenticate   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 12
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 2
eloc 2
c 1
b 0
f 0
dl 0
loc 12
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A handle() 0 3 2
1
<?php
2
3
namespace PavelMironchik\BackupPanel\Http\Middleware;
4
5
use Closure;
6
use Illuminate\Http\Request;
7
use Illuminate\Http\Response;
8
use PavelMironchik\BackupPanel\BackupPanel;
9
10
class Authenticate
11
{
12
    /**
13
     * Handle the incoming request.
14
     *
15
     * @param  Request  $request
16
     * @param  Closure  $next
17
     * @return Response|void
18
     */
19
    public function handle($request, $next)
20
    {
21
        return BackupPanel::check($request) ? $next($request) : abort(403);
0 ignored issues
show
Bug introduced by
Are you sure the usage of abort(403) is correct as it seems to always return null.

This check looks for function or method calls that always return null and whose return value is used.

class A
{
    function getObject()
    {
        return null;
    }

}

$a = new A();
if ($a->getObject()) {

The method getObject() can return nothing but null, so it makes no sense to use the return value.

The reason is most likely that a function or method is imcomplete or has been reduced for debug purposes.

Loading history...
22
    }
23
}
24