1 | <?php |
||
15 | class LaravelTacticianServiceProvider extends ServiceProvider |
||
16 | { |
||
17 | |||
18 | /** |
||
19 | * Do the bindings so any implementation can be swapped |
||
20 | * |
||
21 | * @return void |
||
22 | */ |
||
23 | 26 | public function register() |
|
24 | { |
||
25 | 26 | $this->registerConfig(); |
|
26 | 26 | $this->app->bind('Victormln\LaravelTactician\Locator\LocatorInterface', config('laravel-tactician.locator')); |
|
27 | 26 | $this->app->bind('League\Tactician\Handler\MethodNameInflector\MethodNameInflector', config('laravel-tactician.inflector')); |
|
28 | 26 | $this->app->bind('League\Tactician\Handler\CommandNameExtractor\CommandNameExtractor', config('laravel-tactician.extractor')); |
|
29 | 26 | $this->app->bind('Victormln\LaravelTactician\CommandBusInterface', config('laravel-tactician.bus')); |
|
30 | |||
31 | // Register Command Generator |
||
32 | 26 | $this->app->singleton( |
|
33 | 'laravel-tactician.make.command', function ($app) { |
||
34 | 8 | return new MakeTacticianCommandCommand($app['files']); |
|
35 | 26 | } |
|
36 | ); |
||
37 | 26 | $this->commands('laravel-tactician.make.command'); |
|
38 | |||
39 | // Register Handler Generator |
||
40 | 26 | $this->app->singleton( |
|
41 | 'laravel-tactician.make.handler', function ($app) { |
||
42 | 8 | return new MakeTacticianHandlerCommand($app['files']); |
|
43 | 26 | } |
|
44 | ); |
||
45 | 26 | $this->commands('laravel-tactician.make.handler'); |
|
46 | |||
47 | // Register Comman+Handler Generator Command |
||
48 | 26 | $this->app->singleton( |
|
49 | 'laravel-tactician.make.tactician', function () { |
||
50 | 8 | return new MakeTacticianCommand(); |
|
51 | 26 | } |
|
52 | ); |
||
53 | 26 | $this->commands('laravel-tactician.make.tactician'); |
|
54 | 26 | } |
|
55 | |||
56 | /** |
||
57 | * Register config. |
||
58 | * |
||
59 | * @return void |
||
60 | */ |
||
61 | 26 | protected function registerConfig() |
|
73 | } |
||
74 |