AsyncEvent::getEvent()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 0
1
<?php
2
namespace Workana\AsyncJobs;
3
use Symfony\Component\EventDispatcher\EventDispatcherInterface;
4
5
/**
6
 * @author Carlos Frutos <[email protected]>
7
 */
8
class AsyncEvent extends AsyncAction
9
{
10
    /**
11
     * @var string $eventName
12
     * @var SerializableEvent $event
13
     */
14
    public function __construct($eventName, SerializableEvent $event)
15
    {
16
        parent::__construct(EventDispatcherInterface::class, 'dispatch', [$eventName, $event]);
17
    }
18
19
    /**
20
     * @return string
21
     */
22
    public function getEventName()
23
    {
24
        return $this->parameters[0]->getValue();
25
    }
26
27
    /**
28
     * @return SerializableEvent
29
     */
30
    public function getEvent()
31
    {
32
        return $this->parameters[1]->getValue();
33
    }
34
35
    /**
36
     * @return string
37
     */
38
    public function __toString()
39
    {
40
        return $this->getEventName();
41
    }
42
}