Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
| Total | |
75.00% |
15 / 20 |
|
80.00% |
4 / 5 |
CRAP | |
0.00% |
0 / 1 |
| ApiFlowReply | |
75.00% |
15 / 20 |
|
80.00% |
4 / 5 |
5.39 | |
0.00% |
0 / 1 |
| __construct | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| getBlockParams | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| getAction | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| getAllowedParams | |
100.00% |
12 / 12 |
|
100.00% |
1 / 1 |
1 | |||
| getExamplesMessages | |
0.00% |
0 / 5 |
|
0.00% |
0 / 1 |
2 | |||
| 1 | <?php |
| 2 | |
| 3 | namespace Flow\Api; |
| 4 | |
| 5 | use Wikimedia\ParamValidator\ParamValidator; |
| 6 | |
| 7 | class ApiFlowReply extends ApiFlowBasePost { |
| 8 | |
| 9 | public function __construct( $api, $modName ) { |
| 10 | parent::__construct( $api, $modName, 'rep' ); |
| 11 | } |
| 12 | |
| 13 | /** |
| 14 | * @return array |
| 15 | */ |
| 16 | protected function getBlockParams() { |
| 17 | return [ 'topic' => $this->extractRequestParams() ]; |
| 18 | } |
| 19 | |
| 20 | protected function getAction() { |
| 21 | return 'reply'; |
| 22 | } |
| 23 | |
| 24 | public function getAllowedParams() { |
| 25 | return [ |
| 26 | 'replyTo' => [ |
| 27 | ParamValidator::PARAM_REQUIRED => true, |
| 28 | ], |
| 29 | 'content' => [ |
| 30 | ParamValidator::PARAM_REQUIRED => true, |
| 31 | ], |
| 32 | 'format' => [ |
| 33 | ParamValidator::PARAM_DEFAULT => 'wikitext', |
| 34 | ParamValidator::PARAM_TYPE => [ 'html', 'wikitext' ], |
| 35 | ], |
| 36 | ] + parent::getAllowedParams(); |
| 37 | } |
| 38 | |
| 39 | /** |
| 40 | * @inheritDoc |
| 41 | */ |
| 42 | protected function getExamplesMessages() { |
| 43 | return [ |
| 44 | 'action=flow&submodule=reply&page=Topic:S2tycnas4hcucw8w' . |
| 45 | '&repreplyTo=050e554490c2b269143b080027630f57&repcontent=Nice%20to&20meet%20you' . |
| 46 | '&repformat=wikitext' => 'apihelp-flow+reply-example-1', |
| 47 | ]; |
| 48 | } |
| 49 | } |