Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
| Total | |
0.00% |
0 / 16 |
|
0.00% |
0 / 5 |
CRAP | |
0.00% |
0 / 1 |
| ApiFlowViewPostHistory | |
0.00% |
0 / 16 |
|
0.00% |
0 / 5 |
30 | |
0.00% |
0 / 1 |
| __construct | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| getBlockParams | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| getAction | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| getAllowedParams | |
0.00% |
0 / 9 |
|
0.00% |
0 / 1 |
2 | |||
| getExamplesMessages | |
0.00% |
0 / 4 |
|
0.00% |
0 / 1 |
2 | |||
| 1 | <?php |
| 2 | |
| 3 | namespace Flow\Api; |
| 4 | |
| 5 | use Wikimedia\ParamValidator\ParamValidator; |
| 6 | |
| 7 | class ApiFlowViewPostHistory extends ApiFlowBaseGet { |
| 8 | public function __construct( $api, $modName ) { |
| 9 | parent::__construct( $api, $modName, 'vph' ); |
| 10 | } |
| 11 | |
| 12 | /** |
| 13 | * @return array |
| 14 | */ |
| 15 | protected function getBlockParams() { |
| 16 | return [ 'topic' => $this->extractRequestParams() ]; |
| 17 | } |
| 18 | |
| 19 | protected function getAction() { |
| 20 | return 'view-post-history'; |
| 21 | } |
| 22 | |
| 23 | public function getAllowedParams() { |
| 24 | return [ |
| 25 | 'postId' => [ |
| 26 | ParamValidator::PARAM_REQUIRED => true, |
| 27 | ], |
| 28 | 'format' => [ |
| 29 | ParamValidator::PARAM_TYPE => [ 'html', 'wikitext', 'fixed-html' ], |
| 30 | ParamValidator::PARAM_DEFAULT => 'fixed-html', |
| 31 | ], |
| 32 | ]; |
| 33 | } |
| 34 | |
| 35 | /** |
| 36 | * @inheritDoc |
| 37 | */ |
| 38 | protected function getExamplesMessages() { |
| 39 | return [ |
| 40 | 'action=flow&submodule=view-post-history&page=Topic:S2tycnas4hcucw8w&vphpostId=???&vphformat=wikitext' |
| 41 | => 'apihelp-flow+view-post-history-example-1', |
| 42 | ]; |
| 43 | } |
| 44 | } |