PreDispatchTaskEvent   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 44
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 8
c 1
b 0
f 0
dl 0
loc 44
ccs 0
cts 16
cp 0
rs 10
wmc 4

4 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A isPreventDispatch() 0 3 1
A getTask() 0 3 1
A setPreventDispatch() 0 3 1
1
<?php
2
3
namespace Deployee\Plugins\Deploy\Events;
4
5
6
use Deployee\Plugins\Deploy\Definitions\Tasks\TaskDefinitionInterface;
7
use Symfony\Component\EventDispatcher\Event;
8
9
class PreDispatchTaskEvent extends Event
10
{
11
    /**
12
     * @var TaskDefinitionInterface
13
     */
14
    private $task;
15
16
    /**
17
     * @var bool
18
     */
19
    private $preventDispatch;
20
21
    /**
22
     * PreDispatchTaskEvent constructor.
23
     * @param TaskDefinitionInterface $task
24
     */
25
    public function __construct(TaskDefinitionInterface $task)
26
    {
27
        $this->task = $task;
28
        $this->preventDispatch = false;
29
    }
30
31
    /**
32
     * @return TaskDefinitionInterface
33
     */
34
    public function getTask(): TaskDefinitionInterface
35
    {
36
        return $this->task;
37
    }
38
39
    /**
40
     * @return bool
41
     */
42
    public function isPreventDispatch(): bool
43
    {
44
        return $this->preventDispatch;
45
    }
46
47
    /**
48
     * @param bool $preventDispatch
49
     */
50
    public function setPreventDispatch(bool $preventDispatch)
51
    {
52
        $this->preventDispatch = $preventDispatch;
53
    }
54
}