AuthorizerMiddleware   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 8
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 4
Bugs 0 Features 0
Metric Value
wmc 1
eloc 3
c 4
b 0
f 0
dl 0
loc 8
ccs 3
cts 3
cp 1
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A handle() 0 4 1
1
<?php
2
3
declare(strict_types=1);
4
5
/**
6
 * @author enea dhack <[email protected]>
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
12
namespace Enea\Authorization\Middleware;
13
14
use Closure;
15
use Illuminate\Http\Request;
16
17
abstract class AuthorizerMiddleware
18
{
19
    abstract protected function authorized(array $grantable): void;
20
21 8
    public function handle(Request $request, Closure $next, string ...$grantable)
22
    {
23 8
        $this->authorized($grantable);
24 4
        return $next($request);
25
    }
26
}
27