Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
Total | |
100.00% |
6 / 6 |
|
100.00% |
4 / 4 |
CRAP | |
100.00% |
1 / 1 |
AddSenseRequest | |
100.00% |
6 / 6 |
|
100.00% |
4 / 4 |
4 | |
100.00% |
1 / 1 |
__construct | |
100.00% |
3 / 3 |
|
100.00% |
1 / 1 |
1 | |||
getChangeOp | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
getLexemeId | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
getBaseRevId | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 |
1 | <?php |
2 | |
3 | namespace Wikibase\Lexeme\MediaWiki\Api; |
4 | |
5 | use Wikibase\DataModel\Services\Statement\GuidGenerator; |
6 | use Wikibase\Lexeme\DataAccess\ChangeOp\ChangeOpSenseAdd; |
7 | use Wikibase\Lexeme\Domain\Model\LexemeId; |
8 | use Wikibase\Repo\ChangeOp\ChangeOp; |
9 | |
10 | /** |
11 | * @license GPL-2.0-or-later |
12 | */ |
13 | class AddSenseRequest { |
14 | |
15 | private LexemeId $lexemeId; |
16 | private ChangeOp $editSenseChangeOp; |
17 | private ?int $baseRevId; |
18 | |
19 | public function __construct( |
20 | LexemeId $lexemeId, |
21 | ChangeOp $editSenseChangeOp, |
22 | ?int $baseRevId |
23 | ) { |
24 | $this->lexemeId = $lexemeId; |
25 | $this->editSenseChangeOp = $editSenseChangeOp; |
26 | $this->baseRevId = $baseRevId; |
27 | } |
28 | |
29 | public function getChangeOp(): ChangeOpSenseAdd { |
30 | return new ChangeOpSenseAdd( $this->editSenseChangeOp, new GuidGenerator() ); |
31 | } |
32 | |
33 | public function getLexemeId(): LexemeId { |
34 | return $this->lexemeId; |
35 | } |
36 | |
37 | public function getBaseRevId(): ?int { |
38 | return $this->baseRevId; |
39 | } |
40 | |
41 | } |