SMSServiceProvider::boot()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 15
Code Lines 9

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 2
eloc 9
c 1
b 0
f 0
nc 2
nop 0
dl 0
loc 15
rs 9.9666
1
<?php
2
3
namespace CraftedSystems\LaravelSMS;
4
5
use CraftedSystems\LaravelSMS\Console\MakeGatewayCommand;
6
use Illuminate\Support\ServiceProvider;
7
8
class SMSServiceProvider extends ServiceProvider
9
{
10
    /**
11
     * Bootstrap the application services.
12
     *
13
     * @return void
14
     */
15
    public function boot()
16
    {
17
        $this->publishes([
18
            __DIR__.'/Config/sms.php' => config_path('sms.php'),
0 ignored issues
show
Bug introduced by
The function config_path was not found. Maybe you did not declare it correctly or list all dependencies? ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

18
            __DIR__.'/Config/sms.php' => /** @scrutinizer ignore-call */ config_path('sms.php'),
Loading history...
19
        ], 'laravel_sms_config');
20
21
        $this->app->singleton(SMS::class, function () {
22
            return new SMS();
23
        });
24
25
        $this->app->alias(SMS::class, 'sms');
26
27
        if ($this->app->runningInConsole()) {
28
            $this->commands([
29
                MakeGatewayCommand::class,
30
            ]);
31
        }
32
    }
33
34
    /**
35
     * Register the application services.
36
     *
37
     * @return void
38
     */
39
    public function register()
40
    {
41
        $this->mergeConfigFrom(
42
            __DIR__.'/Config/sms.php',
43
            'laravel-sms'
44
        );
45
    }
46
}
47