Completed
Pull Request — master (#447)
by Marcel
03:00 queued 01:29
created

PushesToPusher   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 20
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

Changes 0
Metric Value
wmc 1
lcom 0
cbo 2
dl 0
loc 20
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A getPusherBroadcaster() 0 11 1
1
<?php
2
3
namespace BeyondCode\LaravelWebSockets\Concerns;
4
5
use Illuminate\Broadcasting\Broadcasters\PusherBroadcaster;
6
use Pusher\Pusher;
7
8
trait PushesToPusher
9
{
10
    /**
11
     * Get the right Pusher broadcaster for the used driver.
12
     *
13
     * @param  array  $app
14
     * @return \Illuminate\Broadcasting\Broadcasters\Broadcaster
15
     */
16
    public function getPusherBroadcaster(array $app)
17
    {
18
        return new PusherBroadcaster(
19
            new Pusher(
20
                $app['key'],
21
                $app['secret'],
22
                $app['id'],
23
                config('broadcasting.connections.pusher.options', [])
24
            )
25
        );
26
    }
27
}
28