Conditions | 2 |
Paths | 2 |
Total Lines | 17 |
Code Lines | 10 |
Lines | 0 |
Ratio | 0 % |
Tests | 10 |
CRAP Score | 2 |
Changes | 1 | ||
Bugs | 0 | Features | 1 |
1 | <?php |
||
42 | 5 | public function handle(ServerWasPoked $event) |
|
43 | { |
||
44 | 5 | $channel = config('broadcasting.connections.pusher.channel'); |
|
45 | 5 | $device = $event->getDevice(); |
|
46 | |||
47 | 5 | if ($device->isPublic()) { |
|
48 | 4 | $this->pusher->trigger($channel, 'ServerWasPoked', [ |
|
49 | 4 | 'device' => $this->transformer->transform($device), |
|
50 | ]); |
||
51 | } else { |
||
52 | 1 | $channel = $channel.'-'.$device->group; |
|
53 | |||
54 | 1 | $this->pusher->trigger($channel, 'ServerWasPoked', [ |
|
55 | 1 | 'device' => $this->transformer->transform($device), |
|
56 | ]); |
||
57 | } |
||
58 | 5 | } |
|
59 | } |
||
60 |