Completed
Push — master ( 615c30...a76a62 )
by Mahmoud
07:04 queued 03:22
created

PoliciesServiceProvider::boot()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 6
rs 9.4285
cc 1
eloc 2
nc 1
nop 1
1
<?php
2
3
namespace App\Containers\User\Settings\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\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