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

PushesToPusher::getPusherBroadcaster()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 11

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 11
rs 9.9
c 0
b 0
f 0
cc 1
nc 1
nop 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