Completed
Push — master ( 66ec7e...c9ec0a )
by Matze
07:32
created

WebSocketEvent   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 28
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Test Coverage

Coverage 0%

Importance

Changes 2
Bugs 0 Features 0
Metric Value
wmc 2
c 2
b 0
f 0
lcom 0
cbo 0
dl 0
loc 28
ccs 0
cts 6
cp 0
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 6 1
A getPayload() 0 4 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
    public function __construct(AbstractEvent $payload)
24
    {
25
        parent::__construct(self::PUSH);
26
27
        $this->payload = $payload;
28
    }
29
30
    /**
31
     * @return AbstractEvent
32
     */
33
    public function getPayload() : AbstractEvent
34
    {
35
        return $this->payload;
36
    }
37
}
38