Completed
Pull Request — master (#26)
by Julien
04:20
created

Event::setFailed()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 6
ccs 0
cts 3
cp 0
rs 9.4285
cc 1
eloc 3
nc 1
nop 1
crap 2
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
    /**
13
     * @var string
14
     */
15
    protected $originalName;
16
17
    /**
18
     * @var bool
19
     */
20
    protected $delayed = true;
21
22
    /**
23
     * @var bool
24
     */
25
    protected $failed = false;
26
27
    /**
28
     * @var int
29
     */
30
    protected $tryCount = 0;
31
32
    /**
33
     * @param bool $delayed
34
     */
35
    public function __construct($delayed = true)
36
    {
37
        $this->delayed = $delayed;
38
    }
39
    /**
40
     * @return boolean
41
     */
42
    public function isDelayed()
43
    {
44
        return $this->delayed;
45
    }
46
47
    /**
48
     * @param boolean $delayed
49
     *
50
     * @return $this
51
     */
52
    public function setDelayed($delayed)
53
    {
54
        $this->delayed = $delayed;
55
56
        return $this;
57
    }
58
59
    /**
60
     * @return string
61
     */
62
    public function getOriginalName()
63
    {
64
        return $this->originalName;
65
    }
66
67
    /**
68
     * @param string $originalName
69
     *
70
     * @return $this
71
     */
72
    public function setOriginalName($originalName)
73
    {
74
        $this->originalName = $originalName;
75
76
        return $this;
77
    }
78
79
    /**
80
     * @return bool
81
     */
82
    public function isFailed()
83
    {
84
        return $this->failed;
85
    }
86
87
    /**
88
     * @param bool $failed
89
     *
90
     * @return $this
91
     */
92
    public function setFailed($failed)
93
    {
94
        $this->failed = $failed;
95
96
        return $this;
97
    }
98
99
    /**
100
     * @return int
101
     */
102
    public function getTryCount()
103
    {
104
        return $this->tryCount;
105
    }
106
107
    /**
108
     * @param int $tryCount
109
     *
110
     * @return $this
111
     */
112
    public function setTryCount($tryCount)
113
    {
114
        $this->tryCount = $tryCount;
115
116
        return $this;
117
    }
118
119
    /**
120
     * Increase try counter
121
     */
122
    public function increaseTryCount()
123
    {
124
        $this->tryCount ++;
125
    }
126
}
127