Completed
Push — master ( d6d8a1...fab734 )
by Elf
04:41
created

CheckAppClientMiddleware   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 18
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Test Coverage

Coverage 0%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 18
ccs 0
cts 7
cp 0
rs 10
wmc 2
lcom 0
cbo 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A handle() 0 8 2
1
<?php
2
3
namespace ElfSundae\Laravel\Support\Services\Agent;
4
5
use Closure;
6
use Illuminate\Auth\Access\AuthorizationException;
7
8
class CheckAppClientMiddleware
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
        if (app('client')->is('AppClient')) {
20
            return $next($request);
21
        }
22
23
        return response('Unauthorized App Client', 403);
24
    }
25
}
26