Completed
Push — master ( 7c85b2...91e0f6 )
by Aly
05:47
created

ExpoPushNotificationsServiceProvider   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 25
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 6

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
wmc 2
lcom 1
cbo 6
dl 0
loc 25
c 0
b 0
f 0
ccs 0
cts 13
cp 0
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A boot() 0 11 1
A register() 0 4 1
1
<?php
2
3
namespace NotificationChannels\ExpoPushNotifications;
4
5
use ExponentPhpSDK\Expo;
6
use ExponentPhpSDK\ExpoRegistrar;
7
use ExponentPhpSDK\ExpoRepository;
8
use ExponentPhpSDK\Repositories\ExpoFileDriver;
9
use Illuminate\Support\ServiceProvider;
10
11
class ExpoPushNotificationsServiceProvider extends ServiceProvider
12
{
13
    /**
14
     * Bootstrap the application services.
15
     */
16
    public function boot()
17
    {
18
        $this->app->when(ExpoChannel::class)
19
            ->needs(Expo::class)
20
            ->give(function () {
21
                return new Expo(new ExpoRegistrar(new ExpoFileDriver()));
22
            });
23
24
        //Load routes
25
        $this->loadRoutesFrom(__DIR__ . '/Http/routes.php');
26
    }
27
28
    /**
29
     * Register the application services.
30
     */
31
    public function register()
32
    {
33
        $this->app->bind(ExpoRepository::class, ExpoFileDriver::class);
34
    }
35
}
36