Completed
Push — master ( e2430d...09e7b1 )
by ARCANEDEV
05:35
created

AuthorizationServiceProvider::defineMany()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 6

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 6
ccs 0
cts 6
cp 0
rs 9.4285
cc 2
eloc 3
nc 2
nop 3
crap 6
1
<?php namespace Arcanedev\Support\Providers;
2
3
use Illuminate\Foundation\Support\Providers\AuthServiceProvider as ServiceProvider;
4
5
/**
6
 * Class     AuthorizationServiceProvider
7
 *
8
 * @package  Arcanedev\Support\Providers
9
 * @author   ARCANEDEV <[email protected]>
10
 */
11
class AuthorizationServiceProvider extends ServiceProvider
12
{
13
    /* ------------------------------------------------------------------------------------------------
14
     |  Main Functions
15
     | ------------------------------------------------------------------------------------------------
16
     */
17
    /**
18
     * Define policies.
19
     *
20
     * @param  \Illuminate\Contracts\Auth\Access\Gate  $gate
21
     * @param  string                                  $class
22
     * @param  array                                   $policies
23
     */
24
    protected function defineMany($gate, $class, array $policies)
25
    {
26
        foreach ($policies as $method => $ability) {
27
            $gate->define($ability, "$class@$method");
28
        }
29
    }
30
}
31