Event   A
last analyzed

Complexity

Total Complexity 11

Size/Duplication

Total Lines 131
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
wmc 11
lcom 1
cbo 1
dl 0
loc 131
ccs 0
cts 28
cp 0
rs 10
c 0
b 0
f 0

11 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A isDelayed() 0 4 1
A setDelayed() 0 6 1
A getOriginalName() 0 4 1
A setOriginalName() 0 6 1
A isFailed() 0 4 1
A setFailed() 0 6 1
A getTryCount() 0 4 1
A setTryCount() 0 6 1
A increaseTryCount() 0 4 1
A getGroupFieldIdentifier() 0 4 1
1
<?php
2
3
namespace Itkg\DelayEventBundle\Model;
4
5
use Symfony\Component\EventDispatcher\Event as BaseEvent;
6
7
/**
8
 * Class Event
9
 */
10
class Event extends BaseEvent
11
{
12
    const DEFAULT_GROUP_IDENTIFIER = 'default_group_identifier';
13
    /**
14
     * @var string
15
     */
16
    protected $originalName;
17
18
    /**
19
     * @var bool
20
     */
21
    protected $delayed = true;
22
23
    /**
24
     * @var bool
25
     */
26
    protected $failed = false;
27
28
    /**
29
     * @var int
30
     */
31
    protected $tryCount = 0;
32
33
    /**
34
     * @var string
35
     */
36
    protected $groupFieldIdentifier;
37
38
    /**
39
     * @param bool $delayed
40
     */
41
    public function __construct($delayed = true)
42
    {
43
        $this->delayed = $delayed;
44
    }
45
    /**
46
     * @return boolean
47
     */
48
    public function isDelayed()
49
    {
50
        return $this->delayed;
51
    }
52
53
    /**
54
     * @param boolean $delayed
55
     *
56
     * @return $this
57
     */
58
    public function setDelayed($delayed)
59
    {
60
        $this->delayed = $delayed;
61
62
        return $this;
63
    }
64
65
    /**
66
     * @return string
67
     */
68
    public function getOriginalName()
69
    {
70
        return $this->originalName;
71
    }
72
73
    /**
74
     * @param string $originalName
75
     *
76
     * @return $this
77
     */
78
    public function setOriginalName($originalName)
79
    {
80
        $this->originalName = $originalName;
81
82
        return $this;
83
    }
84
85
    /**
86
     * @return bool
87
     */
88
    public function isFailed()
89
    {
90
        return $this->failed;
91
    }
92
93
    /**
94
     * @param bool $failed
95
     *
96
     * @return $this
97
     */
98
    public function setFailed($failed)
99
    {
100
        $this->failed = $failed;
101
102
        return $this;
103
    }
104
105
    /**
106
     * @return int
107
     */
108
    public function getTryCount()
109
    {
110
        return $this->tryCount;
111
    }
112
113
    /**
114
     * @param int $tryCount
115
     *
116
     * @return $this
117
     */
118
    public function setTryCount($tryCount)
119
    {
120
        $this->tryCount = $tryCount;
121
122
        return $this;
123
    }
124
125
    /**
126
     * Increase try counter
127
     */
128
    public function increaseTryCount()
129
    {
130
        $this->tryCount ++;
131
    }
132
133
    /**
134
     * @return string
135
     */
136
    public function getGroupFieldIdentifier()
137
    {
138
        return $this->groupFieldIdentifier;
139
    }
140
}
141