Completed
Push — master ( 77d207...af47af )
by Atymic
05:06
created

SnsServiceProvider   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 15
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 7
c 1
b 0
f 0
dl 0
loc 15
ccs 6
cts 6
cp 1
rs 10
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A boot() 0 10 1
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