Completed
Pull Request — master (#3)
by
unknown
04:36
created

SnsServiceProvider::boot()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 10
Code Lines 6

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 6
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 6
c 1
b 0
f 0
nc 1
nop 0
dl 0
loc 10
ccs 6
cts 6
cp 1
crap 1
rs 10
1
<?php
2
3
namespace NotificationChannels\AwsSns;
4
5
use Aws\Sns\SnsClient as SnsService;
6
use Illuminate\Support\ServiceProvider;
7
8
class SnsServiceProvider extends ServiceProvider
9
{
10
    /**
11
     * Bootstrap the application services.
12
     */
13 1
    public function boot()
14
    {
15 1
        $this->app->when(SnsChannel::class)
16 1
            ->needs(Sns::class)
17
            ->give(function () {
18 1
                return new Sns($this->app->make(SnsService::class));
19 1
            });
20
21
        $this->app->bind(SnsService::class, function () {
22 1
            return new SnsService($this->app['config']['services.sns']);
23 1
        });
24 1
    }
25
}
26