Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
Total | |
0.00% |
0 / 5 |
|
0.00% |
0 / 4 |
CRAP | |
0.00% |
0 / 1 |
Link | |
0.00% |
0 / 5 |
|
0.00% |
0 / 4 |
30 | |
0.00% |
0 / 1 |
__construct | |
0.00% |
0 / 2 |
|
0.00% |
0 / 1 |
2 | |||
getTarget | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
getLabel | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
equals | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
6 |
1 | <?php |
2 | |
3 | namespace ProofreadPage; |
4 | |
5 | use MediaWiki\Title\Title; |
6 | |
7 | /** |
8 | * @license GPL-2.0-or-later |
9 | * |
10 | * A link to a MediaWiki page. It is composed by a target and a label |
11 | */ |
12 | class Link { |
13 | |
14 | /** @var Title */ |
15 | private $target; |
16 | |
17 | /** @var string */ |
18 | private $label; |
19 | |
20 | /** |
21 | * @param Title $target |
22 | * @param string $label |
23 | */ |
24 | public function __construct( Title $target, $label ) { |
25 | $this->target = $target; |
26 | $this->label = $label; |
27 | } |
28 | |
29 | /** |
30 | * @return Title |
31 | */ |
32 | public function getTarget() { |
33 | return $this->target; |
34 | } |
35 | |
36 | /** |
37 | * @return string |
38 | */ |
39 | public function getLabel() { |
40 | return $this->label; |
41 | } |
42 | |
43 | /** |
44 | * @param Link $other |
45 | * @return bool |
46 | */ |
47 | public function equals( Link $other ) { |
48 | return $this->target->equals( $other->target ) && $this->label === $other->label; |
49 | } |
50 | } |