Completed
Push — master ( 21c015...b85bcf )
by Antonio Carlos
07:14 queued 05:46
created

Middleware   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 13
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 2
lcom 0
cbo 0
dl 0
loc 13
c 0
b 0
f 0
ccs 5
cts 5
cp 1
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A handle() 0 10 2
1
<?php
2
3
namespace PragmaRX\Google2FALaravel;
4
5
use Closure;
6
use PragmaRX\Google2FALaravel\Support\Authenticator;
7
8
class Middleware
9
{
10 7
    public function handle($request, Closure $next)
11
    {
12 7
        $authenticator = app(Authenticator::class)->boot($request);
13
14 7
        if ($authenticator->isAuthenticated()) {
15 4
            return $next($request);
16
        }
17
18 5
        return $authenticator->makeRequestOneTimePasswordResponse();
19
    }
20
}
21