1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
namespace Badger\Bundle\GameBundle\Entity; |
4
|
|
|
|
5
|
|
|
use Badger\Component\Game\Model\AdventureInterface; |
6
|
|
|
use Badger\Component\Game\Model\AdventureStepInterface; |
7
|
|
|
use Badger\Component\Game\Model\BadgeInterface; |
8
|
|
|
use Doctrine\Common\Collections\ArrayCollection; |
9
|
|
|
|
10
|
|
|
/** |
11
|
|
|
* Adventure Step |
12
|
|
|
* |
13
|
|
|
* @author Marie Bochu <[email protected]> |
14
|
|
|
* @license http://opensource.org/licenses/MIT The MIT License (MIT) |
15
|
|
|
*/ |
16
|
|
|
class AdventureStep implements AdventureStepInterface |
17
|
|
|
{ |
18
|
|
|
/** @var int */ |
19
|
|
|
private $id; |
20
|
|
|
|
21
|
|
|
/** @var string */ |
22
|
|
|
private $title; |
23
|
|
|
|
24
|
|
|
/** @var string */ |
25
|
|
|
private $description; |
26
|
|
|
|
27
|
|
|
/** @var int */ |
28
|
|
|
private $position; |
29
|
|
|
|
30
|
|
|
/** @var int */ |
31
|
|
|
private $rewardPoint; |
32
|
|
|
|
33
|
|
|
/** @var Badge */ |
34
|
|
|
private $badge; |
35
|
|
|
|
36
|
|
|
/** @var Adventure */ |
37
|
|
|
private $adventure; |
38
|
|
|
|
39
|
|
|
/** @var ArrayCollection */ |
40
|
|
|
private $completions; |
41
|
|
|
|
42
|
|
|
/** |
43
|
|
|
* {@inheritdoc} |
44
|
|
|
*/ |
45
|
|
|
public function getId() |
46
|
|
|
{ |
47
|
|
|
return $this->id; |
48
|
|
|
} |
49
|
|
|
|
50
|
|
|
/** |
51
|
|
|
* {@inheritdoc} |
52
|
|
|
*/ |
53
|
|
|
public function setTitle($title) |
54
|
|
|
{ |
55
|
|
|
$this->title = $title; |
56
|
|
|
|
57
|
|
|
return $this; |
58
|
|
|
} |
59
|
|
|
|
60
|
|
|
/** |
61
|
|
|
* {@inheritdoc} |
62
|
|
|
*/ |
63
|
|
|
public function getTitle() |
64
|
|
|
{ |
65
|
|
|
return $this->title; |
66
|
|
|
} |
67
|
|
|
|
68
|
|
|
/** |
69
|
|
|
* {@inheritdoc} |
70
|
|
|
*/ |
71
|
|
|
public function setDescription($description) |
72
|
|
|
{ |
73
|
|
|
$this->description = $description; |
74
|
|
|
|
75
|
|
|
return $this; |
76
|
|
|
} |
77
|
|
|
|
78
|
|
|
/** |
79
|
|
|
* {@inheritdoc} |
80
|
|
|
*/ |
81
|
|
|
public function getDescription() |
82
|
|
|
{ |
83
|
|
|
return $this->description; |
84
|
|
|
} |
85
|
|
|
|
86
|
|
|
/** |
87
|
|
|
* {@inheritdoc} |
88
|
|
|
*/ |
89
|
|
|
public function setPosition($position) |
90
|
|
|
{ |
91
|
|
|
$this->position = $position; |
92
|
|
|
|
93
|
|
|
return $this; |
94
|
|
|
} |
95
|
|
|
|
96
|
|
|
/** |
97
|
|
|
* {@inheritdoc} |
98
|
|
|
*/ |
99
|
|
|
public function getPosition() |
100
|
|
|
{ |
101
|
|
|
return $this->position; |
102
|
|
|
} |
103
|
|
|
|
104
|
|
|
/** |
105
|
|
|
* {@inheritdoc} |
106
|
|
|
*/ |
107
|
|
|
public function setRewardPoint($rewardPoint) |
108
|
|
|
{ |
109
|
|
|
$this->rewardPoint = $rewardPoint; |
110
|
|
|
|
111
|
|
|
return $this; |
112
|
|
|
} |
113
|
|
|
|
114
|
|
|
/** |
115
|
|
|
* {@inheritdoc} |
116
|
|
|
*/ |
117
|
|
|
public function getRewardPoint() |
118
|
|
|
{ |
119
|
|
|
return $this->rewardPoint; |
120
|
|
|
} |
121
|
|
|
|
122
|
|
|
/** |
123
|
|
|
* {@inheritdoc} |
124
|
|
|
*/ |
125
|
|
|
public function setBadge(BadgeInterface $badge) |
126
|
|
|
{ |
127
|
|
|
$this->badge = $badge; |
|
|
|
|
128
|
|
|
|
129
|
|
|
return $this; |
130
|
|
|
} |
131
|
|
|
|
132
|
|
|
/** |
133
|
|
|
* {@inheritdoc} |
134
|
|
|
*/ |
135
|
|
|
public function getBadge() |
136
|
|
|
{ |
137
|
|
|
return $this->badge; |
138
|
|
|
} |
139
|
|
|
|
140
|
|
|
/** |
141
|
|
|
* {@inheritdoc} |
142
|
|
|
*/ |
143
|
|
|
public function setAdventure(AdventureInterface $adventure) |
144
|
|
|
{ |
145
|
|
|
$this->adventure = $adventure; |
|
|
|
|
146
|
|
|
|
147
|
|
|
return $this; |
148
|
|
|
} |
149
|
|
|
|
150
|
|
|
/** |
151
|
|
|
* {@inheritdoc} |
152
|
|
|
*/ |
153
|
|
|
public function getAdventure() |
154
|
|
|
{ |
155
|
|
|
return $this->adventure; |
156
|
|
|
} |
157
|
|
|
|
158
|
|
|
/** |
159
|
|
|
* {@inheritdoc} |
160
|
|
|
*/ |
161
|
|
|
public function getCompletions() |
162
|
|
|
{ |
163
|
|
|
return $this->completions; |
164
|
|
|
} |
165
|
|
|
|
166
|
|
|
/** |
167
|
|
|
* {@inheritdoc} |
168
|
|
|
*/ |
169
|
|
|
public function setCompletions($completions) |
170
|
|
|
{ |
171
|
|
|
$this->completions = $completions; |
172
|
|
|
} |
173
|
|
|
} |
174
|
|
|
|
Our type inference engine has found a suspicous assignment of a value to a property. This check raises an issue when a value that can be of a given class or a super-class is assigned to a property that is type hinted more strictly.
Either this assignment is in error or an instanceof check should be added for that assignment.