Completed
Branch master (4756fb)
by Enea
08:45
created

AuthorizerMiddleware::isAuthorizedRequestFor()   A

Complexity

Conditions 2
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 2

Importance

Changes 0
Metric Value
cc 2
eloc 2
nc 1
nop 1
dl 0
loc 4
ccs 2
cts 2
cp 1
crap 2
rs 10
c 0
b 0
f 0
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