AuthorizationServiceProvider   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 20
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 5

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 1
lcom 0
cbo 5
dl 0
loc 20
ccs 7
cts 7
cp 1
rs 10
c 1
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A boot() 0 9 1
1
<?php namespace Arcanesoft\Blog\Providers;
2
3
use Arcanedev\Support\Providers\AuthorizationServiceProvider as ServiceProvider;
4
use Arcanesoft\Blog\Policies\CategoriesPolicy;
5
use Arcanesoft\Blog\Policies\DashboardPolicy;
6
use Arcanesoft\Blog\Policies\PostsPolicy;
7
use Arcanesoft\Blog\Policies\TagsPolicy;
8
9
/**
10
 * Class     AuthorizationServiceProvider
11
 *
12
 * @package  Arcanesoft\Auth\Providers
13
 * @author   ARCANEDEV <[email protected]>
14
 */
15
class AuthorizationServiceProvider extends ServiceProvider
16
{
17
    /* -----------------------------------------------------------------
18
     |  Main Methods
19
     | -----------------------------------------------------------------
20
     */
21
22
    /**
23
     * Register any application authentication / authorization services.
24
     */
25 102
    public function boot()
26
    {
27 102
        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...
28
29 102
        $this->defineMany(DashboardPolicy::class, DashboardPolicy::policies());
30 102
        $this->defineMany(PostsPolicy::class, PostsPolicy::policies());
31 102
        $this->defineMany(CategoriesPolicy::class, CategoriesPolicy::policies());
32 102
        $this->defineMany(TagsPolicy::class, TagsPolicy::policies());
33 102
    }
34
}
35