WebSocketEvent::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 4
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 6
ccs 4
cts 4
cp 1
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 3
nc 1
nop 1
crap 1
1
<?php
2
3
namespace BrainExe\Core\Websockets;
4
5
use BrainExe\Core\EventDispatcher\AbstractEvent;
6
7
/**
8
 * @api
9
 */
10
class WebSocketEvent extends AbstractEvent
11
{
12
13
    const PUSH = 'websocket.push';
14
15
    /**
16
     * @var AbstractEvent
17
     */
18
    private $payload;
19
20
    /**
21
     * @param AbstractEvent $payload
22
     */
23 2
    public function __construct(AbstractEvent $payload)
24
    {
25 2
        parent::__construct(self::PUSH);
26
27 2
        $this->payload = $payload;
28 2
    }
29
30
    /**
31
     * @return AbstractEvent
32
     */
33 1
    public function getPayload() : AbstractEvent
34
    {
35 1
        return $this->payload;
36
    }
37
}
38