Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
Total | |
0.00% |
0 / 11 |
|
0.00% |
0 / 5 |
CRAP | |
0.00% |
0 / 1 |
ContributionInfo | |
0.00% |
0 / 11 |
|
0.00% |
0 / 5 |
30 | |
0.00% |
0 / 1 |
__construct | |
0.00% |
0 / 3 |
|
0.00% |
0 / 1 |
2 | |||
getNumLocalEdits | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
getNumRecentEdits | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
getNumDeletedEdits | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
jsonSerialize | |
0.00% |
0 / 5 |
|
0.00% |
0 / 1 |
2 |
1 | <?php |
2 | |
3 | namespace MediaWiki\IPInfo\Info; |
4 | |
5 | use JsonSerializable; |
6 | |
7 | class ContributionInfo implements JsonSerializable { |
8 | private int $numLocalEdits; |
9 | |
10 | private int $numRecentEdits; |
11 | private int $numDeletedEdits; |
12 | |
13 | public function __construct( |
14 | int $numLocalEdits = 0, |
15 | int $numRecentEdits = 0, |
16 | int $numDeletedEdits = 0 |
17 | ) { |
18 | $this->numLocalEdits = $numLocalEdits; |
19 | $this->numRecentEdits = $numRecentEdits; |
20 | $this->numDeletedEdits = $numDeletedEdits; |
21 | } |
22 | |
23 | public function getNumLocalEdits(): int { |
24 | return $this->numLocalEdits; |
25 | } |
26 | |
27 | public function getNumRecentEdits(): int { |
28 | return $this->numRecentEdits; |
29 | } |
30 | |
31 | public function getNumDeletedEdits(): int { |
32 | return $this->numDeletedEdits; |
33 | } |
34 | |
35 | public function jsonSerialize(): array { |
36 | return [ |
37 | 'numLocalEdits' => $this->getNumLocalEdits(), |
38 | 'numRecentEdits' => $this->getNumRecentEdits(), |
39 | 'numDeletedEdits' => $this->getNumDeletedEdits(), |
40 | ]; |
41 | } |
42 | } |