WebSocketEvent   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 28
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Test Coverage

Coverage 100%

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A getPayload() 0 4 1
A __construct() 0 6 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