AuthorizationServiceProvider::boot()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 10
Code Lines 7

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 8
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 10
ccs 8
cts 8
cp 1
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 7
nc 1
nop 0
crap 1
1
<?php namespace Arcanesoft\Seo\Providers;
2
3
use Arcanedev\Support\Providers\AuthorizationServiceProvider as ServiceProvider;
4
use Arcanesoft\Seo\Policies\DashboardPolicy;
5
use Arcanesoft\Seo\Policies\FootersPolicy;
6
use Arcanesoft\Seo\Policies\MetasPolicy;
7
use Arcanesoft\Seo\Policies\PagesPolicy;
8
use Arcanesoft\Seo\Policies\RedirectsPolicy;
9
10
/**
11
 * Class AuthorizationServiceProvider
12
 *
13
 * @package  Arcanesoft\Seo\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 16
    public function boot()
27
    {
28 16
        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 16
        $this->defineMany(DashboardPolicy::class, DashboardPolicy::policies());
31 16
        $this->defineMany(PagesPolicy::class,     PagesPolicy::policies());
32 16
        $this->defineMany(FootersPolicy::class,   FootersPolicy::policies());
33 16
        $this->defineMany(MetasPolicy::class,     MetasPolicy::policies());
34 16
        $this->defineMany(RedirectsPolicy::class, RedirectsPolicy::policies());
35 16
    }
36
}
37