QueueProcessEvent   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 51
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 3
lcom 0
cbo 1
dl 0
loc 51
ccs 9
cts 9
cp 1
rs 10
c 0
b 0
f 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 6 1
A getCommand() 0 4 1
A getProcessor() 0 4 1
1
<?php
2
3
namespace Gendoria\CommandQueueBundle\Event;
4
5
use Gendoria\CommandQueue\Command\CommandInterface;
6
use Gendoria\CommandQueue\CommandProcessor\CommandProcessorInterface;
7
use Gendoria\CommandQueue\Worker\WorkerInterface;
8
9
/**
10
 * Event raised, when queue worker is run.
11
 *
12
 * @author Tomasz Struczyński <[email protected]>
13
 */
14
class QueueProcessEvent extends QueueWorkerRunEvent
15
{
16
    /**
17
     * Command.
18
     * 
19
     * @var CommandInterface
20
     */
21
    private $command;
22
    
23
    /**
24
     * Command processor.
25
     * 
26
     * @var CommandProcessorInterface
27
     */
28
    private $processor;
29
30
    /**
31
     * Class constructor.
32
     *
33
     * @param WorkerInterface           $worker Worker processing this command.
34
     * @param CommandInterface          $command
35
     * @param CommandProcessorInterface $processor
36
     * @param string                    $subsystem Subsystem name.
37
     */
38 4
    public function __construct(WorkerInterface $worker, CommandInterface $command, CommandProcessorInterface $processor, $subsystem = null)
39
    {
40 4
        parent::__construct($worker, $subsystem);
41 4
        $this->command = $command;
42 4
        $this->processor = $processor;
43 4
    }
44
    
45
    /**
46
     * Get command.
47
     * 
48
     * @return CommandInterface
49
     */
50 2
    public function getCommand()
51
    {
52 2
        return $this->command;
53
    }
54
55
    /**
56
     * Get command processor.
57
     * 
58
     * @return CommandProcessorInterface
59
     */
60 2
    public function getProcessor()
61
    {
62 2
        return $this->processor;
63
    }
64
}
65