11
11
12
12
namespace AltThree \Locker ;
13
13
14
- use Illuminate \Contracts \Foundation \ Application ;
14
+ use Illuminate \Contracts \Container \ Container ;
15
15
use Illuminate \Foundation \Application as LaravelApplication ;
16
16
use Illuminate \Support \ServiceProvider ;
17
17
use Laravel \Lumen \Application as LumenApplication ;
@@ -30,24 +30,22 @@ class LockerServiceProvider extends ServiceProvider
30
30
*/
31
31
public function boot ()
32
32
{
33
- $ this ->setupConfig ($ this -> app );
33
+ $ this ->setupConfig ();
34
34
}
35
35
36
36
/**
37
37
* Setup the config.
38
38
*
39
- * @param \Illuminate\Contracts\Foundation\Application $app
40
- *
41
39
* @return void
42
40
*/
43
- protected function setupConfig (Application $ app )
41
+ protected function setupConfig ()
44
42
{
45
43
$ source = realpath (__DIR__ .'/../config/locker.php ' );
46
44
47
- if ($ app instanceof LaravelApplication && $ app ->runningInConsole ()) {
45
+ if ($ this -> app instanceof LaravelApplication && $ this -> app ->runningInConsole ()) {
48
46
$ this ->publishes ([$ source => config_path ('locker.php ' )]);
49
- } elseif ($ app instanceof LumenApplication) {
50
- $ app ->configure ('locker ' );
47
+ } elseif ($ this -> app instanceof LumenApplication) {
48
+ $ this -> app ->configure ('locker ' );
51
49
}
52
50
53
51
$ this ->mergeConfigFrom ($ source , 'locker ' );
@@ -60,25 +58,23 @@ protected function setupConfig(Application $app)
60
58
*/
61
59
public function register ()
62
60
{
63
- $ this ->registerLocker ($ this -> app );
61
+ $ this ->registerLocker ();
64
62
}
65
63
66
64
/**
67
65
* Register the locker class.
68
66
*
69
- * @param \Illuminate\Contracts\Foundation\Application $app
70
- *
71
67
* @return void
72
68
*/
73
- protected function registerLocker (Application $ app )
69
+ protected function registerLocker ()
74
70
{
75
- $ app ->singleton ('locker ' , function (Application $ app ) {
71
+ $ this -> app ->singleton ('locker ' , function (Container $ app ) {
76
72
$ redis = $ app ['redis ' ]->connection ($ app ->config ->get ('locker.connection ' ));
77
73
78
74
return new Locker ($ redis );
79
75
});
80
76
81
- $ app ->alias ('locker ' , Locker::class);
77
+ $ this -> app ->alias ('locker ' , Locker::class);
82
78
}
83
79
84
80
/**
0 commit comments