PushesToPusher::getPusherBroadcaster()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 8
Code Lines 6

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 6
c 0
b 0
f 0
nc 1
nop 1
dl 0
loc 8
rs 10
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