Skip to content
This repository has been archived by the owner on Sep 11, 2023. It is now read-only.

Commit

Permalink
change app share to singleton
Browse files Browse the repository at this point in the history
  • Loading branch information
SergioMLeon committed Jul 20, 2017
1 parent 2fe25c0 commit 9e630a1
Showing 1 changed file with 6 additions and 10 deletions.
16 changes: 6 additions & 10 deletions src/GitSnifferServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,17 +41,13 @@ public function register()
$configPath = __DIR__ . '/../config/git-sniffer.php';
$this->mergeConfigFrom($configPath, 'git-sniffer');

$this->app['command.git-sniffer.copy'] = $this->app->share(
function ($app) {
return new CopyHookCommand($app['config'], $app['files']);
}
);
$this->app->singleton('command.git-sniffer.copy', function ($app) {
return new CopyHookCommand($app['config'], $app['files']);
});

$this->app['command.git-sniffer.check'] = $this->app->share(
function ($app) {
return new CodeSnifferCommand($app['config'], $app['files']);
}
);
$this->app->singleton('command.git-sniffer.check', function ($app) {
return new CodeSnifferCommand($app['config'], $app['files']);
});

$this->commands('command.git-sniffer.copy', 'command.git-sniffer.check');
}
Expand Down

0 comments on commit 9e630a1

Please sign in to comment.