SourceSiteMiddleware   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 15
Duplicated Lines 0 %

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A handle() 0 6 2
1
<?php
2
3
namespace FaithGen\SDK\Http\Middleware;
4
5
use Closure;
6
7
class SourceSiteMiddleware
8
{
9
    /**
10
     * Handle an incoming request.
11
     *
12
     * @param \Illuminate\Http\Request $request
13
     * @param \Closure $next
14
     * @return mixed
15
     */
16
    public function handle($request, Closure $next)
17
    {
18
        if (config('faithgen-sdk.source')) {
19
            return $next($request);
20
        } else {
21
            abort(403, 'You are not allowed to perform this action');
22
        }
23
    }
24
}
25