diff --git a/CHANGELOG.md b/CHANGELOG.md index a8af05a..55939ba 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # CHANGELOG +## 3.2.2 (released 2016-01-30) + +- Improved service provider + ## 3.2.1 (released 2016-01-17) - Lumen 5.2 support diff --git a/src/InstagramServiceProvider.php b/src/InstagramServiceProvider.php index 5b941a1..6bbd504 100644 --- a/src/InstagramServiceProvider.php +++ b/src/InstagramServiceProvider.php @@ -11,7 +11,7 @@ namespace Vinkla\Instagram; -use Illuminate\Contracts\Container\Container as Application; +use Illuminate\Contracts\Container\Container; use Illuminate\Foundation\Application as LaravelApplication; use Illuminate\Support\ServiceProvider; use Laravel\Lumen\Application as LumenApplication; @@ -59,62 +59,56 @@ protected function setupConfig() */ public function register() { - $this->registerFactory($this->app); - $this->registerManager($this->app); - $this->registerBindings($this->app); + $this->registerFactory(); + $this->registerManager(); + $this->registerBindings(); } /** * Register the factory class. * - * @param \Illuminate\Contracts\Container\Container $app - * * @return void */ - protected function registerFactory(Application $app) + protected function registerFactory() { - $app->singleton('instagram.factory', function () { + $this->app->singleton('instagram.factory', function () { return new InstagramFactory(); }); - $app->alias('instagram.factory', InstagramFactory::class); + $this->app->alias('instagram.factory', InstagramFactory::class); } /** * Register the manager class. * - * @param \Illuminate\Contracts\Container\Container $app - * * @return void */ - protected function registerManager(Application $app) + protected function registerManager() { - $app->singleton('instagram', function ($app) { + $this->app->singleton('instagram', function (Container $app) { $config = $app['config']; $factory = $app['instagram.factory']; return new InstagramManager($config, $factory); }); - $app->alias('instagram', InstagramManager::class); + $this->app->alias('instagram', InstagramManager::class); } /** * Register the bindings. * - * @param \Illuminate\Contracts\Container\Container $app - * * @return void */ - protected function registerBindings(Application $app) + protected function registerBindings() { - $app->bind('instagram.connection', function ($app) { + $this->app->bind('instagram.connection', function (Container $app) { $manager = $app['instagram']; return $manager->connection(); }); - $app->alias('instagram.connection', Instagram::class); + $this->app->alias('instagram.connection', Instagram::class); } /**