ValidateRelativeSignature   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 19
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A handle() 0 9 2
1
<?php
2
3
namespace Clickbar\ValidateRelativeSignature\Http\Middleware;
4
5
use Closure;
6
use Illuminate\Routing\Exceptions\InvalidSignatureException;
7
8
class ValidateRelativeSignature
9
{
10
    /**
11
     * Handle an incoming request.
12
     *
13
     * @param  \Illuminate\Http\Request  $request
14
     * @param  \Closure  $next
15
     * @return mixed
16
     */
17
    public function handle($request, Closure $next)
18
    {
19
        $isAbsolute = false;
20
        if ($request->hasValidSignature($isAbsolute)) {
21
            return $next($request);
22
        }
23
24
        throw new InvalidSignatureException();
25
    }
26
}
27