MpesaServiceProvider::boot()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 14

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 14
rs 9.7998
c 0
b 0
f 0
cc 2
nc 2
nop 0
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