RestrictAccessByBasicAuthentication   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 17
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 0
Metric Value
wmc 2
lcom 0
cbo 1
dl 0
loc 17
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A handle() 0 6 2
1
<?php
2
3
namespace Tequilarapido\RestrictAccess\Middlewares;
4
5
use Closure;
6
use Tequilarapido\RestrictAccess\Restricter\BasicAuthRestricter;
7
8
class RestrictAccessByBasicAuthentication
9
{
10
    /**
11
     * Handle an incoming request.
12
     *
13
     * @param \Illuminate\Http\Request $request
14
     * @param \Closure $next
15
     *
16
     * @return mixed
17
     */
18
    public function handle($request, Closure $next)
19
    {
20
        $response = (new BasicAuthRestricter($request))->restrict();
21
22
        return $response === false ? $next($request) : $response;
23
    }
24
}
25