PusherBeamsServiceProvider   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 16
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 4

Importance

Changes 0
Metric Value
wmc 1
lcom 1
cbo 4
dl 0
loc 16
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A boot() 0 13 1
1
<?php
2
3
namespace Rich2k\PusherBeams;
4
5
use Illuminate\Support\ServiceProvider;
6
use Pusher\PushNotifications\PushNotifications;
7
8
class PusherBeamsServiceProvider extends ServiceProvider
9
{
10
    public function boot()
11
    {
12
        $this->app->when(PusherBeams::class)
13
            ->needs(PushNotifications::class)
14
            ->give(function () {
15
                $pusherConfig = config('broadcasting.connections.pusher');
16
17
                return new PushNotifications([
18
                    'secretKey' => array_get($pusherConfig, 'beams.secret_key'),
19
                    'instanceId' => array_get($pusherConfig, 'beams.instance_id'),
20
                ]);
21
            });
22
    }
23
}
24