DelayedEvent   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 30
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 30
ccs 7
cts 7
cp 1
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 7 1
A getTimestamp() 0 4 1
1
<?php
2
3
namespace BrainExe\Core\EventDispatcher;
4
5
use BrainExe\Core\MessageQueue\Event\MessageQueueEvent;
6
7
/**
8
 * @api
9
 */
10
class DelayedEvent extends MessageQueueEvent
11
{
12
13
    const DELAYED = 'message_queue.delayed';
14
15
    /**
16
     * @var int
17
     */
18
    private $timestamp;
19
20
    /**
21
     * @param AbstractEvent $event
22
     * @param int $timestamp
23
     */
24 3
    public function __construct(AbstractEvent $event, int $timestamp)
25
    {
26 3
        parent::__construct(self::DELAYED);
27
28 3
        $this->event      = $event;
29 3
        $this->timestamp  = $timestamp;
30 3
    }
31
32
    /**
33
     * @return int
34
     */
35 2
    public function getTimestamp() : int
36
    {
37 2
        return $this->timestamp;
38
    }
39
}
40