Completed
Push — master ( c104d5...38ca07 )
by Zura
07:16
created

SMSOfficeServiceProvider   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 16
Duplicated Lines 0 %

Test Coverage

Coverage 80%

Importance

Changes 3
Bugs 0 Features 0
Metric Value
wmc 1
c 3
b 0
f 0
dl 0
loc 16
ccs 4
cts 5
cp 0.8
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A boot() 0 8 1
1
<?php
2
3
namespace Gabievi\LaravelSMSOffice;
4
5
use Illuminate\Support\ServiceProvider;
6
use Gabievi\LaravelSMSOffice\Exceptions\InvalidConfiguration;
7
8
class SMSOfficeServiceProvider extends ServiceProvider
9
{
10
    /**
11
     * Perform post-registration booting of services.
12
     *
13
     * @return void
14
     * @throws InvalidConfiguration
15
     */
16 2
    public function boot()
17
    {
18 2
        $config = config('services.smsoffice');
19
20 2
        throw_unless($config, InvalidConfiguration::class);
21
22 1
        $this->app->singleton(SMSOffice::class, function () use ($config) {
23
            return new SMSOffice($config['key'], $config['sender']);
24 1
        });
25
    }
26
}
27