JusibeServiceProvider   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 23
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 5

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
wmc 2
lcom 1
cbo 5
dl 0
loc 23
ccs 0
cts 14
cp 0
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A boot() 0 17 2
1
<?php
2
3
namespace NotificationChannels\Jusibe;
4
5
use Illuminate\Support\ServiceProvider;
6
use NotificationChannels\Jusibe\Exceptions\InvalidConfiguration;
7
use Unicodeveloper\Jusibe\Jusibe as JusibeClient;
8
9
class JusibeServiceProvider extends ServiceProvider
10
{
11
    /**
12
     * Bootstrap the application services.
13
     */
14
    public function boot()
15
    {
16
        $this->app->when(JusibeChannel::class)
17
            ->needs(JusibeClient::class)
18
            ->give(function () {
19
                $config = config('services.jusibe');
20
21
                if (is_null($config)) {
22
                    throw InvalidConfiguration::configurationNotSet();
23
                }
24
25
                return new JusibeClient(
26
                    $config['key'],
27
                    $config['token']
28
                );
29
            });
30
    }
31
}
32