Completed
Push — master ( 1c4593...ca959b )
by Tomasz
09:01
created

QueueBeforeTranslateEvent::getCommandData()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 4
ccs 0
cts 2
cp 0
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 0
crap 2
1
<?php
2
3
namespace Gendoria\CommandQueueBundle\Event;
4
5
use Gendoria\CommandQueue\Worker\WorkerInterface;
6
7
/**
8
 * Event raised, when queue worker is run.
9
 *
10
 * @author Tomasz Struczyński <[email protected]>
11
 */
12
class QueueBeforeTranslateEvent extends QueueWorkerRunEvent
13
{
14
    /**
15
     * Command data before translation.
16
     * 
17
     * @var mixed
18
     */
19
    private $commandData;
20
    
21
    /**
22
     * Class constructor.
23
     *
24
     * @param WorkerInterface   $worker Worker processing this command.
25
     * @param mixed             $commandData
26
     * @param string            $subsystem Subsystem name.
27
     */
28 3
    public function __construct(WorkerInterface $worker, $commandData, $subsystem = null)
29
    {
30
        parent::__construct($worker, $subsystem);
31 3
        $this->commandData = $commandData;
32
    }
33
    
34
    /**
35
     * Get command data before translation.
36
     * 
37
     * @return mixed
38
     */
39
    public function getCommandData()
40
    {
41
        return $this->commandData;
42
    }
43
    
44
    /**
45
     * Set new command data.
46
     * 
47
     * @param mixed $commandData
48
     */
49 1
    public function setCommandData($commandData)
50
    {
51 1
        $this->commandData = $commandData;
52 1
    }
53
}
54