PaystackLiteServiceProvider   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 31
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 4

Importance

Changes 0
Metric Value
wmc 3
lcom 1
cbo 4
dl 0
loc 31
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A boot() 0 11 2
A register() 0 10 1
1
<?php
2
3
namespace Stephenjude\PaystackLite;
4
5
use Illuminate\Support\ServiceProvider;
6
use Stephenjude\PaystackLite\Blade\PaystackBladeDirective;
7
8
class PaystackLiteServiceProvider extends ServiceProvider
9
{
10
    /**
11
     * Bootstrap the application services.
12
     */
13
    public function boot()
14
    {
15
16
        if ($this->app->runningInConsole()) {
17
            $this->publishes([
18
                __DIR__ . '/../config/paystack-lite.php' => config_path('paystack-lite.php'),
19
            ], 'config');
20
        }
21
22
        PaystackBladeDirective::register();
23
    }
24
25
    /**
26
     * Register the application services.
27
     */
28
    public function register()
29
    {
30
        // Automatically apply the package configuration
31
        $this->mergeConfigFrom(__DIR__ . '/../config/paystack-lite.php', 'paystack-lite');
32
33
        // Register the main class to use with the facade
34
        $this->app->singleton('paystack-lite', function () {
35
            return new PaystackLite;
36
        });
37
    }
38
}
39