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

PhpSmsServiceProvider   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 37
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 3
c 1
b 0
f 0
lcom 0
cbo 1
dl 0
loc 37
rs 10
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