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

Commit

Permalink
Updated service provider
Browse files Browse the repository at this point in the history
  • Loading branch information
GrahamCampbell committed Jan 24, 2016
1 parent 6ee9e2e commit 7c444d2
Showing 1 changed file with 5 additions and 8 deletions.
13 changes: 5 additions & 8 deletions src/SegmentServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@

namespace AltThree\Segment;

use Illuminate\Contracts\Foundation\Application;
use Illuminate\Foundation\Application as LaravelApplication;
use Illuminate\Support\ServiceProvider;
use Laravel\Lumen\Application as LumenApplication;
Expand All @@ -31,7 +30,7 @@ class SegmentServiceProvider extends ServiceProvider
*/
public function boot()
{
$this->setupConfig($this->app);
$this->setupConfig();

if ($writeKey = $this->app->config->get('segment.write_key')) {
Segment::init($writeKey);
Expand All @@ -41,18 +40,16 @@ public function boot()
/**
* Setup the config.
*
* @param \Illuminate\Contracts\Foundation\Application $app
*
* @return void
*/
protected function setupConfig(Application $app)
protected function setupConfig()
{
$source = realpath(__DIR__.'/../config/segment.php');

if ($app instanceof LaravelApplication && $app->runningInConsole()) {
if ($this->app instanceof LaravelApplication && $this->app->runningInConsole()) {
$this->publishes([$source => config_path('segment.php')]);
} elseif ($app instanceof LumenApplication) {
$app->configure('segment');
} elseif ($this->app instanceof LumenApplication) {
$this->app->configure('segment');
}

$this->mergeConfigFrom($source, 'segment');
Expand Down

0 comments on commit 7c444d2

Please sign in to comment.