Completed
Push — master ( 1ed135...6ab2d0 )
by Mahmoud
04:32 queued 14s
created

PoliciesServiceProvider   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 26
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 1
c 1
b 0
f 0
lcom 0
cbo 1
dl 0
loc 26
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A boot() 0 6 1
1
<?php
2
3
namespace App\Containers\User\Providers;
4
5
use Illuminate\Contracts\Auth\Access\Gate as GateContract;
6
use Illuminate\Foundation\Support\Providers\AuthServiceProvider as ServiceProvider;
7
use App\Containers\User\Models\User;
8
use App\Containers\User\UI\API\Policies\UserPolicy;
9
10
/**
11
 * Class PoliciesServiceProvider.
12
 *
13
 * This Service Provider is designed to map the policies to their models.
14
 * Must be manually added to the list of extra service providers in the
15
 * containers config file in order to get registered in the framework.
16
 *
17
 * @author Mahmoud Zalt <[email protected]>
18
 */
19
class PoliciesServiceProvider extends ServiceProvider
20
{
21
22
    /**
23
     * The policy mappings for the application.
24
     *
25
     * @var array
26
     */
27
    protected $policies = [
28
        User::class => UserPolicy::class,
29
    ];
30
31
    /**
32
     * Register any application authentication / authorization services.
33
     *
34
     * @param \Illuminate\Contracts\Auth\Access\Gate $gate
35
     *
36
     * @return void
37
     */
38
    public function boot(GateContract $gate)
39
    {
40
        parent::registerPolicies($gate);
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...
41
42
        //
43
    }
44
}
45