Passed
Push — master ( 605a7f...c53e78 )
by Marcel
14:27 queued 03:25
created

PrivateChannel::subscribe()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 2
c 0
b 0
f 0
nc 1
nop 2
dl 0
loc 5
rs 10
1
<?php
2
3
namespace BeyondCode\LaravelWebSockets\Channels;
4
5
use BeyondCode\LaravelWebSockets\Server\Exceptions\InvalidSignature;
6
use Ratchet\ConnectionInterface;
7
use stdClass;
8
9
class PrivateChannel extends Channel
10
{
11
    /**
12
     * Subscribe to the channel.
13
     *
14
     * @see    https://pusher.com/docs/pusher_protocol#presence-channel-events
15
     *
16
     * @param  \Ratchet\ConnectionInterface  $connection
17
     * @param  \stdClass  $payload
18
     * @return bool
19
     *
20
     * @throws InvalidSignature
21
     */
22
    public function subscribe(ConnectionInterface $connection, stdClass $payload): bool
23
    {
24
        $this->verifySignature($connection, $payload);
25
26
        return parent::subscribe($connection, $payload);
27
    }
28
}
29