Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
Total | |
88.89% |
8 / 9 |
|
83.33% |
5 / 6 |
CRAP | |
0.00% |
0 / 1 |
Command | |
88.89% |
8 / 9 |
|
83.33% |
5 / 6 |
6.05 | |
0.00% |
0 / 1 |
__construct | |
100.00% |
4 / 4 |
|
100.00% |
1 / 1 |
1 | |||
getId | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
getKeyword | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
getArguments | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
getTimestamp | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
setId | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 |
1 | <?php |
2 | /** @noinspection PhpUnhandledExceptionInspection */ |
3 | declare(strict_types=1); |
4 | |
5 | class Command extends DataCollectionTypeSafe { |
6 | |
7 | protected $id = -1; |
8 | protected $keyword = ""; |
9 | protected $arguments = []; |
10 | protected $timestamp = -1; |
11 | |
12 | function __construct(int $id, string $keyword, int $timestamp, ...$arguments) { |
13 | |
14 | $this->id = $id; |
15 | $this->keyword = $keyword; |
16 | $this->timestamp = $timestamp; |
17 | $this->arguments = array_map(function($arg) {return (string) $arg;}, $arguments); |
18 | } |
19 | |
20 | public function getId(): int { |
21 | |
22 | return $this->id; |
23 | } |
24 | |
25 | public function getKeyword(): string { |
26 | |
27 | return $this->keyword; |
28 | } |
29 | |
30 | public function getArguments(): array { |
31 | |
32 | return $this->arguments; |
33 | } |
34 | |
35 | public function getTimestamp(): int { |
36 | |
37 | return $this->timestamp; |
38 | } |
39 | |
40 | public function setId($commandId) { |
41 | |
42 | $this->id = $commandId; |
43 | } |
44 | } |