Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
Total | |
100.00% |
3 / 3 |
|
100.00% |
2 / 2 |
CRAP | |
100.00% |
1 / 1 |
DummySenseId | |
100.00% |
3 / 3 |
|
100.00% |
2 / 2 |
3 | |
100.00% |
1 / 1 |
equals | |
100.00% |
2 / 2 |
|
100.00% |
1 / 1 |
2 | |||
stemsFromNewlyCreatedSense | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 |
1 | <?php |
2 | |
3 | namespace Wikibase\Lexeme\Domain\DummyObjects; |
4 | |
5 | use Wikibase\Lexeme\Domain\Model\SenseId; |
6 | |
7 | /** |
8 | * An ID for a BlankSense which has already been associated with a particular lexeme. |
9 | * |
10 | * @license GPL-2.0-or-later |
11 | */ |
12 | class DummySenseId extends SenseId { |
13 | |
14 | public function equals( $target ) { |
15 | return $this->stemsFromNewlyCreatedSense( $target ) |
16 | || parent::equals( $target ); |
17 | } |
18 | |
19 | /** |
20 | * @param mixed $target |
21 | * @return bool |
22 | */ |
23 | private function stemsFromNewlyCreatedSense( $target ) { |
24 | return $target instanceof NullSenseId; |
25 | } |
26 | |
27 | } |