Total Complexity | 5 |
Total Lines | 41 |
Duplicated Lines | 0 % |
Changes | 4 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
8 | class PaystackServiceProvider extends ServiceProvider |
||
9 | { |
||
10 | /** |
||
11 | * Bootstrap the application services. |
||
12 | */ |
||
13 | public function boot(): void |
||
21 | } |
||
22 | |||
23 | /** |
||
24 | * Register the application services. |
||
25 | */ |
||
26 | public function register(): void |
||
27 | { |
||
28 | // Automatically apply the package configuration |
||
29 | $this->mergeConfigFrom(__DIR__.'/../config/config.php', 'paystack'); |
||
30 | |||
31 | // Register the main class to use with the facade |
||
32 | $this->app->bind('paystack', function () { |
||
33 | |||
34 | //validate required credentials |
||
35 | $config = config('paystack'); |
||
36 | Validator::make($config, [ |
||
37 | 'secret_key' => 'required|string', |
||
38 | ])->validate(); |
||
39 | |||
40 | return new Paystack(config('paystack.secret_key')); |
||
41 | }); |
||
42 | } |
||
43 | |||
44 | |||
45 | private function validator() |
||
49 | }); |
||
50 | } |
||
53 |
This check looks for parameters that have been defined for a function or method, but which are not used in the method body.