Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
Total | |
0.00% |
0 / 11 |
|
0.00% |
0 / 5 |
CRAP | |
0.00% |
0 / 1 |
MWNamespace | |
0.00% |
0 / 11 |
|
0.00% |
0 / 5 |
30 | |
0.00% |
0 / 1 |
__construct | |
0.00% |
0 / 3 |
|
0.00% |
0 / 1 |
2 | |||
getId | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
getCanonicalName | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
getDisplayName | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
jsonSerialize | |
0.00% |
0 / 5 |
|
0.00% |
0 / 1 |
2 |
1 | <?php |
2 | |
3 | namespace NSFileRepo; |
4 | |
5 | class MWNamespace implements \JsonSerializable { |
6 | |
7 | /** |
8 | * |
9 | * @var int |
10 | */ |
11 | protected $id = ''; |
12 | |
13 | /** |
14 | * |
15 | * @var string |
16 | */ |
17 | protected $canonicalName = ''; |
18 | |
19 | /** |
20 | * |
21 | * @var string |
22 | */ |
23 | protected $displayName = ''; |
24 | |
25 | /** |
26 | * |
27 | * @param int $id |
28 | * @param string $canonicalName |
29 | * @param string $displayName |
30 | */ |
31 | public function __construct( $id, $canonicalName, $displayName ) { |
32 | $this->id = (int)$id; |
33 | $this->canonicalName = $canonicalName; |
34 | $this->displayName = $displayName; |
35 | } |
36 | |
37 | /** |
38 | * |
39 | * @return int |
40 | */ |
41 | public function getId() { |
42 | return $this->id; |
43 | } |
44 | |
45 | /** |
46 | * |
47 | * @return string |
48 | */ |
49 | public function getCanonicalName() { |
50 | return $this->canonicalName; |
51 | } |
52 | |
53 | /** |
54 | * |
55 | * @return string |
56 | */ |
57 | public function getDisplayName() { |
58 | return $this->displayName; |
59 | } |
60 | |
61 | /** |
62 | * |
63 | * @return array |
64 | */ |
65 | public function jsonSerialize(): array { |
66 | return [ |
67 | 'id' => $this->getId(), |
68 | 'canonicalName' => $this->getCanonicalName(), |
69 | 'displayName' => $this->getDisplayName() |
70 | ]; |
71 | } |
72 | |
73 | } |