SmsServiceProvider   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 43
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 3

Importance

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

3 Methods

Rating   Name   Duplication   Size   Complexity  
A boot() 0 6 1
A register() 0 6 1
A provides() 0 4 1
1
<?php
2
3
namespace Laravelsms\Sms;
4
5
use Illuminate\Support\ServiceProvider;
6
use Laravelsms\Sms\Manager;
7
8
class SmsServiceProvider extends ServiceProvider
9
{
10
    /**
11
     * Indicates if loading of the provider is deferred.
12
     *
13
     * @var bool
14
     */
15
    protected $defer = true;
16
17
    /**
18
     * Perform post-registration booting of services.
19
     *
20
     * @return void
21
     */
22
    public function boot()
23
    {
24
        $this->publishes([
25
            __DIR__ . '/config/sms.php' => config_path('sms.php'),
26
        ], 'phpsms');
27
    }
28
29
    /**
30
     * Register the application services.
31
     *
32
     * @return void
33
     */
34
    public function register()
35
    {
36
        $this->app->singleton('sms', function () {
37
            return new Manager($this->app);
38
        });
39
    }
40
41
    /**
42
     * Get the services provided by the provider.
43
     *
44
     * @return array
45
     */
46
    public function provides()
47
    {
48
        return ['sms'];
49
    }
50
}
51