CronEvent::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 4

Duplication

Lines 7
Ratio 100 %

Code Coverage

Tests 5
CRAP Score 1

Importance

Changes 0
Metric Value
dl 7
loc 7
ccs 5
cts 5
cp 1
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 4
nc 1
nop 2
crap 1
1
<?php
2
3
namespace BrainExe\Core\EventDispatcher;
4
5
use BrainExe\Core\MessageQueue\Event\MessageQueueEvent;
6
use BrainExe\Core\Traits\JsonSerializableTrait;
7
8
/**
9
 * @api
10
 */
11 View Code Duplication
class CronEvent extends MessageQueueEvent implements PushViaWebsocket
12
{
13
    use JsonSerializableTrait;
14
15
    const CRON = 'message_queue.cron';
16
17
    /**
18
     * @var string
19
     */
20
    private $expression;
21
22
    /**
23
     * @param AbstractEvent $event
24
     * @param string $expression
25
     */
26 3
    public function __construct(AbstractEvent $event, string $expression)
27
    {
28 3
        parent::__construct(self::CRON);
29
30 3
        $this->event      = $event;
31 3
        $this->expression = $expression;
32 3
    }
33
34
    /**
35
     * @return string
36
     */
37 3
    public function getExpression() : string
38
    {
39 3
        return $this->expression;
40
    }
41
}
42