1 | <?php |
||
2 | |||
3 | /** |
||
4 | * Part of the AmazonGiftCode package. |
||
5 | * Author: Kashyap Merai <[email protected]> |
||
6 | * |
||
7 | */ |
||
8 | |||
9 | |||
10 | namespace kamerk22\AmazonGiftCode; |
||
11 | |||
12 | use Illuminate\Support\ServiceProvider; |
||
13 | |||
14 | class AmazonGiftCodeServiceProvider extends ServiceProvider |
||
15 | { |
||
16 | /** |
||
17 | * Perform post-registration booting of services. |
||
18 | * |
||
19 | * @return void |
||
20 | */ |
||
21 | public function boot() |
||
22 | { |
||
23 | // Publishing is only necessary when using the CLI. |
||
24 | if ($this->app->runningInConsole()) { |
||
25 | $this->bootForConsole(); |
||
26 | } |
||
27 | } |
||
28 | |||
29 | /** |
||
30 | * Register any package services. |
||
31 | * |
||
32 | * @return void |
||
33 | */ |
||
34 | public function register() |
||
35 | { |
||
36 | $this->mergeConfigFrom(__DIR__.'/../config/amazongiftcode.php', 'amazongiftcode'); |
||
37 | |||
38 | // Register the service the package provides. |
||
39 | $this->app->singleton('amazongiftcode', function ($app) { |
||
0 ignored issues
–
show
|
|||
40 | return new AmazonGiftCode; |
||
41 | }); |
||
42 | } |
||
43 | |||
44 | /** |
||
45 | * Get the services provided by the provider. |
||
46 | * |
||
47 | * @return array |
||
48 | */ |
||
49 | public function provides() |
||
50 | { |
||
51 | return ['amazongiftcode']; |
||
52 | } |
||
53 | |||
54 | /** |
||
55 | * Console-specific booting. |
||
56 | * |
||
57 | * @return void |
||
58 | */ |
||
59 | protected function bootForConsole() |
||
60 | { |
||
61 | // Publishing the configuration file. |
||
62 | $this->publishes([ |
||
63 | __DIR__.'/../config/amazongiftcode.php' => config_path('amazongiftcode.php'), |
||
64 | ], 'amazongiftcode.config'); |
||
65 | |||
66 | } |
||
67 | } |
||
68 |
This check looks for parameters that have been defined for a function or method, but which are not used in the method body.