Skip to content
This repository was archived by the owner on Apr 13, 2022. It is now read-only.

Commit 12fd323

Browse files
Updated service provider
1 parent 60df8ef commit 12fd323

File tree

1 file changed

+10
-14
lines changed

1 file changed

+10
-14
lines changed

src/LockerServiceProvider.php

+10-14
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111

1212
namespace AltThree\Locker;
1313

14-
use Illuminate\Contracts\Foundation\Application;
14+
use Illuminate\Contracts\Container\Container;
1515
use Illuminate\Foundation\Application as LaravelApplication;
1616
use Illuminate\Support\ServiceProvider;
1717
use Laravel\Lumen\Application as LumenApplication;
@@ -30,24 +30,22 @@ class LockerServiceProvider extends ServiceProvider
3030
*/
3131
public function boot()
3232
{
33-
$this->setupConfig($this->app);
33+
$this->setupConfig();
3434
}
3535

3636
/**
3737
* Setup the config.
3838
*
39-
* @param \Illuminate\Contracts\Foundation\Application $app
40-
*
4139
* @return void
4240
*/
43-
protected function setupConfig(Application $app)
41+
protected function setupConfig()
4442
{
4543
$source = realpath(__DIR__.'/../config/locker.php');
4644

47-
if ($app instanceof LaravelApplication && $app->runningInConsole()) {
45+
if ($this->app instanceof LaravelApplication && $this->app->runningInConsole()) {
4846
$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');
5149
}
5250

5351
$this->mergeConfigFrom($source, 'locker');
@@ -60,25 +58,23 @@ protected function setupConfig(Application $app)
6058
*/
6159
public function register()
6260
{
63-
$this->registerLocker($this->app);
61+
$this->registerLocker();
6462
}
6563

6664
/**
6765
* Register the locker class.
6866
*
69-
* @param \Illuminate\Contracts\Foundation\Application $app
70-
*
7167
* @return void
7268
*/
73-
protected function registerLocker(Application $app)
69+
protected function registerLocker()
7470
{
75-
$app->singleton('locker', function (Application $app) {
71+
$this->app->singleton('locker', function (Container $app) {
7672
$redis = $app['redis']->connection($app->config->get('locker.connection'));
7773

7874
return new Locker($redis);
7975
});
8076

81-
$app->alias('locker', Locker::class);
77+
$this->app->alias('locker', Locker::class);
8278
}
8379

8480
/**

0 commit comments

Comments
 (0)