Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
| Total | |
25.00% |
2 / 8 |
|
50.00% |
2 / 4 |
CRAP | |
0.00% |
0 / 1 |
| ApiDisabled | |
28.57% |
2 / 7 |
|
50.00% |
2 / 4 |
9.83 | |
0.00% |
0 / 1 |
| execute | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| isReadMode | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| getSummaryMessage | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| getExtendedDescription | |
0.00% |
0 / 4 |
|
0.00% |
0 / 1 |
2 | |||
| 1 | <?php |
| 2 | /** |
| 3 | * Copyright © 2008 Roan Kattouw <roan.kattouw@gmail.com> |
| 4 | * |
| 5 | * @license GPL-2.0-or-later |
| 6 | * @file |
| 7 | */ |
| 8 | |
| 9 | namespace MediaWiki\Api; |
| 10 | |
| 11 | /** |
| 12 | * API module that dies with an error immediately. |
| 13 | * |
| 14 | * Use this to disable core modules with |
| 15 | * $wgAPIModules['modulename'] = 'ApiDisabled'; |
| 16 | * |
| 17 | * To disable submodules of action=query, use ApiQueryDisabled instead |
| 18 | * |
| 19 | * @ingroup API |
| 20 | */ |
| 21 | class ApiDisabled extends ApiBase { |
| 22 | |
| 23 | public function execute(): never { |
| 24 | $this->dieWithError( [ 'apierror-moduledisabled', $this->getModuleName() ] ); |
| 25 | } |
| 26 | |
| 27 | /** @inheritDoc */ |
| 28 | public function isReadMode() { |
| 29 | return false; |
| 30 | } |
| 31 | |
| 32 | /** @inheritDoc */ |
| 33 | protected function getSummaryMessage() { |
| 34 | return 'apihelp-disabled-summary'; |
| 35 | } |
| 36 | |
| 37 | /** @inheritDoc */ |
| 38 | protected function getExtendedDescription() { |
| 39 | return [ [ |
| 40 | 'apihelp-disabled-extended-description', |
| 41 | 'api-help-no-extended-description', |
| 42 | ] ]; |
| 43 | } |
| 44 | } |
| 45 | |
| 46 | /** @deprecated class alias since 1.43 */ |
| 47 | class_alias( ApiDisabled::class, 'ApiDisabled' ); |