ZonerSmsGatewayServiceProvider::boot()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 14
Code Lines 9

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 1
Bugs 0 Features 0
Metric Value
dl 0
loc 14
ccs 0
cts 13
cp 0
rs 9.4285
c 1
b 0
f 0
cc 1
eloc 9
nc 1
nop 0
crap 2
1
<?php
2
3
namespace NotificationChannels\ZonerSmsGateway;
4
5
use Illuminate\Support\ServiceProvider;
6
7
class ZonerSmsGatewayServiceProvider extends ServiceProvider
8
{
9
    /**
10
     * Bootstrap the application services.
11
     */
12
    public function boot()
13
    {
14
        $this->app->when(ZonerSmsGatewayChannel::class)
15
            ->needs(ZonerSmsGateway::class)
16
            ->give(function () {
17
                $zonerSmsGatewayConfig = config('services.zoner-sms-gateway');
18
19
                return new ZonerSmsGateway(
20
                    $zonerSmsGatewayConfig['username'],
21
                    $zonerSmsGatewayConfig['password'],
22
                    $zonerSmsGatewayConfig['sender']
23
                );
24
            });
25
    }
26
27
    /**
28
     * Register the application services.
29
     */
30
    public function register()
31
    {
32
    }
33
}
34