AuthorizationServiceProvider   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 20
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
dl 0
loc 20
ccs 0
cts 4
cp 0
rs 10
c 0
b 0
f 0
wmc 2
lcom 0
cbo 2

1 Method

Rating   Name   Duplication   Size   Complexity  
A defineMany() 0 6 2
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Arcanedev\Support\Providers;
6
7
use Illuminate\Foundation\Support\Providers\AuthServiceProvider;
8
use Illuminate\Support\Facades\Gate;
9
10
/**
11
 * Class     AuthorizationServiceProvider
12
 *
13
 * @author   ARCANEDEV <[email protected]>
14
 */
15
abstract class AuthorizationServiceProvider extends AuthServiceProvider
16
{
17
    /* -----------------------------------------------------------------
18
     |  Main Methods
19
     | -----------------------------------------------------------------
20
     */
21
22
    /**
23
     * Define policies.
24
     *
25
     * @param  string  $class
26
     * @param  array   $policies
27
     */
28
    protected function defineMany($class, array $policies)
29
    {
30
        foreach ($policies as $ability => $method) {
31
            Gate::define($ability, "$class@$method");
32
        }
33
    }
34
}
35