GuardianServiceProvider   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 33
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Importance

Changes 0
Metric Value
wmc 2
lcom 1
cbo 2
dl 0
loc 33
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A register() 0 13 1
A boot() 0 5 1
1
<?php namespace Usman\Guardian\AccessControl;
2
3
use Illuminate\Foundation\AliasLoader;
4
use Illuminate\Support\ServiceProvider;
5
6
class GuardianServiceProvider extends ServiceProvider {
7
8
	 /**
9
     * Register the service provider.
10
     *
11
     * @return void
12
     */
13
    public function register()
14
    {   
15
        $this->app->bindShared('guardian',function($app)
0 ignored issues
show
Bug introduced by
The method bindShared() does not seem to exist on object<Illuminate\Contra...Foundation\Application>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
16
        {
17
            return new Guardian($app['auth']);
18
        });
19
20
        /*$this->app->booting(function() //registers a boot listener... should better go in boot().
21
        {
22
            $loader = AliasLoader::getInstance();
23
            $loader->alias('Guardian','Usman\Guardian\AccessControl\GuardianFacade');
24
        });*/ 
25
    }
26
27
    /**
28
     * Adds an alias for the GuardianFacade
29
     * 
30
     * @return void
31
     */
32
    public function boot()
33
    {
34
        $loader = AliasLoader::getInstance();
35
        $loader->alias('Guardian','Usman\Guardian\AccessControl\GuardianFacade');
36
    }
37
    
38
}