Completed
Push — master ( 7328ed...c4af57 )
by ARCANEDEV
04:44
created

AuthorizationServiceProvider   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 27
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 6

Test Coverage

Coverage 100%

Importance

Changes 3
Bugs 0 Features 0
Metric Value
wmc 2
c 3
b 0
f 0
lcom 0
cbo 6
dl 0
loc 27
ccs 12
cts 12
cp 1
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A boot() 0 16 2
1
<?php namespace Arcanesoft\Auth\Providers;
2
3
use Arcanedev\Support\Providers\AuthorizationServiceProvider as ServiceProvider;
4
use Arcanesoft\Auth\Policies\DashboardPolicy;
5
use Arcanesoft\Auth\Policies\PasswordResetsPolicy;
6
use Arcanesoft\Auth\Policies\PermissionsPolicy;
7
use Arcanesoft\Auth\Policies\RolesPolicy;
8
use Arcanesoft\Auth\Policies\UsersPolicy;
9
10
/**
11
 * Class     AuthorizationServiceProvider
12
 *
13
 * @package  Arcanesoft\Auth\Providers
14
 * @author   ARCANEDEV <[email protected]>
15
 */
16
class AuthorizationServiceProvider extends ServiceProvider
17
{
18
    /* -----------------------------------------------------------------
19
     |  Main Methods
20
     | -----------------------------------------------------------------
21
     */
22
23
    /**
24
     * Register any application authentication / authorization services.
25
     */
26 12
    public function boot()
27
    {
28 12
        parent::registerPolicies();
0 ignored issues
show
Comprehensibility Bug introduced by
It seems like you call parent on a different method (registerPolicies() instead of boot()). Are you sure this is correct? If so, you might want to change this to $this->registerPolicies().

This check looks for a call to a parent method whose name is different than the method from which it is called.

Consider the following code:

class Daddy
{
    protected function getFirstName()
    {
        return "Eidur";
    }

    protected function getSurName()
    {
        return "Gudjohnsen";
    }
}

class Son
{
    public function getFirstName()
    {
        return parent::getSurname();
    }
}

The getFirstName() method in the Son calls the wrong method in the parent class.

Loading history...
29
30
        $authPolicies = [
31 12
            DashboardPolicy::class      => DashboardPolicy::policies(),
32 12
            UsersPolicy::class          => UsersPolicy::policies(),
33 12
            RolesPolicy::class          => RolesPolicy::policies(),
34 12
            PermissionsPolicy::class    => PermissionsPolicy::policies(),
35 12
            PasswordResetsPolicy::class => PasswordResetsPolicy::policies()
36 6
        ];
37
38 12
        foreach ($authPolicies as $class => $policies) {
39 12
            $this->defineMany($class, $policies);
40 6
        }
41 12
    }
42
}
43