QueueBeforeGetProcessorEvent::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 4
CRAP Score 1

Importance

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