MpesaServiceProvider   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 34
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 3

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A boot() 0 14 2
A register() 0 10 1
1
<?php
2
3
namespace Konectdigital\Mpesa;
4
5
use Illuminate\Support\ServiceProvider;
6
use Konectdigital\Mpesa\Console\InstallMpesaPackage;
7
8
class MpesaServiceProvider extends ServiceProvider
9
{
10
    /**
11
     * Bootstrap the application services.
12
     */
13
    public function boot()
14
    {
15
16
        if ($this->app->runningInConsole()) {
17
            // publish config file
18
            $this->publishes([
19
                __DIR__ . '/../config/config.php' => config_path('mpesa.php'),
20
            ], 'config');
21
22
            $this->commands([
23
                InstallMpesaPackage::class,
24
            ]);
25
        }
26
    }
27
28
    /**
29
     * Register the application services.
30
     */
31
    public function register()
32
    {
33
        // Automatically apply the package configuration
34
        $this->mergeConfigFrom(__DIR__ . '/../config/config.php', 'mpesa');
35
36
        // Register the main class to use with the facade
37
        $this->app->bind('mpesa', function ($app) {
0 ignored issues
show
Unused Code introduced by
The parameter $app is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
38
            return new Mpesa();
39
        });
40
    }
41
}
42