Code Duplication    Length = 30-30 lines in 2 locations

src/EventDispatcher/CronEvent.php 1 location

@@ 11-40 (lines=30) @@
8
/**
9
 * @api
10
 */
11
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
    public function __construct(AbstractEvent $event, string $expression)
27
    {
28
        parent::__construct(self::CRON);
29
        $this->event      = $event;
30
        $this->expression = $expression;
31
    }
32
33
    /**
34
     * @return string
35
     */
36
    public function getExpression() : string
37
    {
38
        return $this->expression;
39
    }
40
}
41

src/EventDispatcher/JobEvent.php 1 location

@@ 11-40 (lines=30) @@
8
/**
9
 * @api
10
 */
11
class JobEvent extends AbstractEvent implements PushViaWebsocket
12
{
13
    use JsonSerializableTrait;
14
15
    const ADDED   = 'message_queue.added';
16
    const HANDLED = 'message_queue.handled';
17
18
    /**
19
     * @var Job
20
     */
21
    private $job;
22
23
    /**
24
     * @param string $type
25
     * @param Job $job
26
     */
27
    public function __construct(string $type, Job $job)
28
    {
29
        parent::__construct($type);
30
        $this->job  = $job;
31
    }
32
33
    /**
34
     * @return Job
35
     */
36
    public function getJob() : Job
37
    {
38
        return $this->job;
39
    }
40
}
41