Completed
Pull Request — master (#70)
by lan tian
02:08
created

PhpSmsServiceProvider::boot()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 4

Duplication

Lines 0
Ratio 0 %
Metric Value
dl 0
loc 7
rs 9.4285
cc 1
eloc 4
nc 1
nop 0
1
<?php
2
3
namespace Toplan\PhpSms;
4
5
use Illuminate\Support\ServiceProvider;
6
7
class PhpSmsServiceProvider extends ServiceProvider
8
{
9
    /**
10
     * bootstrap
11
     */
12
    public function boot()
13
    {
14
        //publish config files
15
        $this->publishes([
16
            __DIR__ . '/../config/phpsms.php' => config_path('phpsms.php'),
17
        ], 'config');
18
    }
19
20
    /**
21
     * register service provider
22
     */
23
    public function register()
24
    {
25
        //merge configs
26
        $this->mergeConfigFrom(
27
            __DIR__ . '/../config/phpsms.php', 'phpsms'
28
        );
29
30
        Sms::scheme(config('phpsms.scheme', []);
0 ignored issues
show
Bug introduced by
This code did not parse for me. Apparently, there is an error somewhere around this line:

Syntax error, unexpected ';', expecting ',' or ')'
Loading history...
31
        Sms::config(config('phpsms.agents', []));
32
33
        $this->app->singleton('PhpSms', function () {
34
            return new Sms(false);
35
        });
36
    }
37
}
38