Completed
Push — master ( b47537...37aec8 )
by ARCANEDEV
10s
created

AuthorizationServiceProvider::boot()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 4
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 6
rs 9.4285
ccs 4
cts 4
cp 1
cc 1
eloc 3
nc 1
nop 0
crap 1
1
<?php namespace Arcanedev\LaravelImpersonator\Providers;
2
3
use Arcanedev\LaravelImpersonator\Policies\ImpersonationPolicy;
4
use Arcanedev\Support\Providers\AuthorizationServiceProvider as ServiceProvider;
5
6
/**
7
 * Class     AuthorizationServiceProvider
8
 *
9
 * @package  Arcanedev\LaravelImpersonator\Providers
10
 * @author   ARCANEDEV <[email protected]>
11
 */
12
class AuthorizationServiceProvider extends ServiceProvider
13
{
14
    /* -----------------------------------------------------------------
15
     |  Main Methods
16
     | -----------------------------------------------------------------
17
     */
18
19
    /**
20
     * Register any application authentication / authorization services.
21
     */
22 72
    public function boot()
23
    {
24 72
        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...
25
26 72
        $this->defineMany(ImpersonationPolicy::class, ImpersonationPolicy::policies());
27 72
    }
28
}
29