GuardianServiceProvider::boot()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 5
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 3
nc 1
nop 0
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
}