Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
Total | |
80.00% |
4 / 5 |
|
50.00% |
1 / 2 |
CRAP | |
0.00% |
0 / 1 |
InvalidItemId | |
80.00% |
4 / 5 |
|
50.00% |
1 / 2 |
2.03 | |
0.00% |
0 / 1 |
__construct | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
asApiMessage | |
100.00% |
4 / 4 |
|
100.00% |
1 / 1 |
1 |
1 | <?php |
2 | |
3 | namespace Wikibase\Lexeme\MediaWiki\Api\Error; |
4 | |
5 | use MediaWiki\Api\ApiMessage; |
6 | use MediaWiki\Message\Message; |
7 | |
8 | /** |
9 | * @license GPL-2.0-or-later |
10 | */ |
11 | class InvalidItemId implements ApiError { |
12 | /** |
13 | * @var string |
14 | */ |
15 | private $given; |
16 | |
17 | /** |
18 | * @param string $given |
19 | */ |
20 | public function __construct( $given ) { |
21 | $this->given = $given; |
22 | } |
23 | |
24 | /** @inheritDoc */ |
25 | public function asApiMessage( $parameterName, array $path ) { |
26 | return new ApiMessage( new Message( |
27 | 'apierror-wikibaselexeme-invalid-item-id', |
28 | [ $parameterName, implode( '/', $path ), $this->given ] |
29 | ), 'bad-request' ); |
30 | } |
31 | |
32 | } |