1 | <?php |
||
2 | /** |
||
3 | * Copyright (c) 2019 - present |
||
4 | * laravel-updown - UpDownServiceProvider.php |
||
5 | * author: Roberto Belotti - [email protected] |
||
6 | * web : robertobelotti.com, github.com/biscolab |
||
7 | * Initial version created on: 15/2/2019 |
||
8 | * MIT license: https://github.com/biscolab/laravel-updown/blob/master/LICENSE |
||
9 | */ |
||
10 | |||
11 | namespace Biscolab\LaravelUpDown; |
||
12 | |||
13 | use Biscolab\UpDown\Fields\UpDownRequestFields; |
||
14 | use Biscolab\UpDown\UpDown; |
||
15 | use Illuminate\Support\ServiceProvider; |
||
16 | |||
17 | /** |
||
18 | * Class UpDownServiceProvider |
||
19 | * @package Biscolab\LaravelUpDown |
||
20 | */ |
||
21 | class UpDownServiceProvider extends ServiceProvider { |
||
22 | |||
23 | /** |
||
24 | * Indicates if loading of the provider is deferred. |
||
25 | * |
||
26 | * @var bool |
||
27 | */ |
||
28 | protected $defer = true; |
||
29 | |||
30 | /** |
||
31 | * |
||
32 | */ |
||
33 | 7 | public function boot() { |
|
34 | |||
35 | 7 | $this->publishes([ |
|
36 | 7 | __DIR__ . '/../config/updown.php' => config_path('updown.php'), |
|
37 | ]); |
||
38 | |||
39 | 7 | } |
|
40 | |||
41 | /** |
||
42 | * Register the service provider. |
||
43 | * |
||
44 | * @return void |
||
45 | */ |
||
46 | 7 | public function register() { |
|
47 | |||
48 | 7 | $this->mergeConfigFrom( |
|
49 | 7 | __DIR__ . '/../config/updown.php', 'updown' |
|
50 | ); |
||
51 | |||
52 | 7 | $this->registerUpDownBuilder(); |
|
53 | 7 | } |
|
54 | |||
55 | /** |
||
56 | * Get the services provided by the provider. |
||
57 | * |
||
58 | * @return array |
||
59 | */ |
||
60 | 1 | public function provides(): array { |
|
61 | |||
62 | 1 | return ['updown']; |
|
63 | } |
||
64 | |||
65 | /** |
||
66 | * Register the UpDown builder instance. |
||
67 | * |
||
68 | * @return void |
||
69 | */ |
||
70 | 7 | protected function registerUpDownBuilder() { |
|
71 | |||
72 | $this->app->singleton('updown', function ($app) { |
||
0 ignored issues
–
show
|
|||
73 | |||
74 | 7 | return new UpDownBuilder(config('updown.api_key')); |
|
75 | |||
76 | 7 | }); |
|
77 | 7 | } |
|
78 | |||
79 | } |
||
80 |
This check looks for parameters that have been defined for a function or method, but which are not used in the method body.