1 | <?php |
||
41 | class Tick { |
||
42 | |||
43 | |||
44 | use TArrayTools; |
||
45 | |||
46 | |||
47 | /** @var int */ |
||
48 | private $id; |
||
49 | |||
50 | /** @var string */ |
||
51 | private $source; |
||
52 | |||
53 | /** @var array */ |
||
54 | protected $data; |
||
55 | |||
56 | /** @var int */ |
||
57 | private $tick; |
||
58 | |||
59 | /** @var int */ |
||
60 | private $firstTick; |
||
61 | |||
62 | /** @var string */ |
||
63 | private $status; |
||
64 | |||
65 | /** @var string */ |
||
66 | private $action = ''; |
||
67 | |||
68 | |||
69 | /** |
||
70 | * Tick constructor. |
||
71 | * |
||
72 | * @param string $source |
||
73 | * @param int $id |
||
74 | */ |
||
75 | public function __construct(string $source, int $id = 0) { |
||
79 | |||
80 | |||
81 | /** |
||
82 | * @return int |
||
83 | */ |
||
84 | public function getId(): int { |
||
87 | |||
88 | /** |
||
89 | * @param int $id |
||
90 | * |
||
91 | * @return $this |
||
92 | */ |
||
93 | public function setId(int $id): Tick { |
||
98 | |||
99 | |||
100 | /** |
||
101 | * @return string |
||
102 | */ |
||
103 | public function getSource(): string { |
||
106 | |||
107 | |||
108 | /** |
||
109 | * @return array |
||
110 | */ |
||
111 | public function getData(): array { |
||
114 | |||
115 | /** |
||
116 | * @param array $data |
||
117 | * |
||
118 | * @return $this |
||
119 | */ |
||
120 | public function setData(array $data): Tick { |
||
125 | |||
126 | |||
127 | /** |
||
128 | * @return int |
||
129 | */ |
||
130 | public function getTick(): int { |
||
133 | |||
134 | /** |
||
135 | * @param int $tick |
||
136 | * |
||
137 | * @return $this |
||
138 | */ |
||
139 | public function setTick(int $tick = 0): Tick { |
||
148 | |||
149 | |||
150 | /** |
||
151 | * @return int |
||
152 | */ |
||
153 | public function getFirstTick(): int { |
||
156 | |||
157 | /** |
||
158 | * @param int $tick |
||
159 | * |
||
160 | * @return $this |
||
161 | */ |
||
162 | public function setFirstTick(int $tick = 0): Tick { |
||
171 | |||
172 | |||
173 | /** |
||
174 | * @return string |
||
175 | */ |
||
176 | public function getStatus(): string { |
||
179 | |||
180 | /** |
||
181 | * @param string $status |
||
182 | * |
||
183 | * @return $this |
||
184 | */ |
||
185 | public function setStatus(string $status): Tick { |
||
190 | |||
191 | |||
192 | /** |
||
193 | * @return string |
||
194 | */ |
||
195 | public function getAction(): string { |
||
198 | |||
199 | /** |
||
200 | * @param string $action |
||
201 | * |
||
202 | * @return $this |
||
203 | */ |
||
204 | public function setAction(string $action): Tick { |
||
209 | |||
210 | |||
211 | /** |
||
212 | * @param string $info |
||
213 | * @param string $value |
||
214 | * |
||
215 | * @return $this |
||
216 | */ |
||
217 | public function setInfo(string $info, string $value): Tick { |
||
222 | |||
223 | /** |
||
224 | * @param string $info |
||
225 | * @param int $value |
||
226 | * |
||
227 | * @return $this |
||
228 | */ |
||
229 | public function setInfoInt(string $info, int $value): Tick { |
||
234 | |||
235 | /** |
||
236 | * @param string $info |
||
237 | * @param float $value |
||
238 | * |
||
239 | * @return $this |
||
240 | */ |
||
241 | public function setInfoFloat(string $info, float $value): Tick { |
||
246 | |||
247 | /** |
||
248 | * @param string $info |
||
249 | */ |
||
250 | public function unsetInfo(string $info) { |
||
253 | |||
254 | /** |
||
255 | * @param string $info |
||
256 | * @param string $default |
||
257 | * |
||
258 | * @return string |
||
259 | */ |
||
260 | public function getInfo(string $info, string $default = ''): string { |
||
263 | |||
264 | |||
265 | /** |
||
266 | * @param string $info |
||
267 | * @param int $default |
||
268 | * |
||
269 | * @return int |
||
270 | */ |
||
271 | public function getInfoInt(string $info, int $default = 0): int { |
||
274 | |||
275 | /** |
||
276 | * @param string $info |
||
277 | * @param float $default |
||
|
|||
278 | * |
||
279 | * @return float |
||
280 | */ |
||
281 | public function getInfoFloat(string $info, float $default = 0): float { |
||
284 | |||
285 | } |
||
286 | |||
287 |
This check looks for
@param
annotations where the type inferred by our type inference engine differs from the declared type.It makes a suggestion as to what type it considers more descriptive.
Most often this is a case of a parameter that can be null in addition to its declared types.