ServiceProvider   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 51
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 3

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 2
c 1
b 0
f 0
lcom 1
cbo 3
dl 0
loc 51
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A register() 0 15 1
A boot() 0 6 1
1
<?php
2
3
namespace Akibatech\FreeMobileSms;
4
5
use Akibatech\FreeMobileSms\FreeMobileSms;
6
7
/**
8
 * Class ServiceProvider
9
 *
10
 * @package Akibatech\FreeMobileSms
11
 */
12
class ServiceProvider extends \Illuminate\Support\ServiceProvider
13
{
14
    /**
15
     * @var bool
16
     */
17
    protected $defer = false;
18
19
    /**
20
     * @var string
21
     */
22
    protected $configName = 'laravel-free-mobile-sms';
23
24
    //-------------------------------------------------------------------------
25
26
    /**
27
     * Register the service provider.
28
     *
29
     * @return void
30
     */
31
    public function register()
32
    {
33
        $configPath = __DIR__ . '/../config/' . $this->configName . '.php';
34
35
        $this->mergeConfigFrom($configPath, $this->configName);
36
37
        $this->app->bind(FreeMobileSms::class, FreeMobileSms::class);
38
39
        $this->app->singleton('freemobile', 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...
40
        {
41
            return new FreeMobileSms();
42
        });
43
44
        $this->app->alias('freemobile', FreeMobileSms::class);
45
    }
46
47
    //-------------------------------------------------------------------------
48
49
    /**
50
     * Bootstrap the application events.
51
     *
52
     * @return void
53
     */
54
    public function boot()
55
    {
56
        $configPath = __DIR__ . '/../config/' . $this->configName . '.php';
57
58
        $this->publishes([$configPath => config_path($this->configName . '.php')], 'config');
59
    }
60
61
    //-------------------------------------------------------------------------
62
}
63