SMSOfficeServiceProvider   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 16
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 3
Bugs 0 Features 0
Metric Value
wmc 1
c 3
b 0
f 0
dl 0
loc 16
ccs 5
cts 5
cp 1
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 3
    public function boot()
17
    {
18 3
        $config = config('services.smsoffice');
19
20 3
        throw_unless($config, InvalidConfiguration::class);
21
22 2
        $this->app->singleton(SMSOffice::class, function () use ($config) {
23 1
            return new SMSOffice($config['key'], $config['sender']);
24 2
        });
25
    }
26
}
27