Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
Total | |
0.00% |
0 / 20 |
|
0.00% |
0 / 5 |
CRAP | |
0.00% |
0 / 1 |
ApiFlowModeratePost | |
0.00% |
0 / 20 |
|
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 / 12 |
|
0.00% |
0 / 1 |
2 | |||
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 ApiFlowModeratePost extends ApiFlowBasePost { |
8 | |
9 | public function __construct( $api, $modName ) { |
10 | parent::__construct( $api, $modName, 'mp' ); |
11 | } |
12 | |
13 | protected function getBlockParams() { |
14 | return [ 'topic' => $this->extractRequestParams() ]; |
15 | } |
16 | |
17 | protected function getAction() { |
18 | return 'moderate-post'; |
19 | } |
20 | |
21 | public function getAllowedParams() { |
22 | return [ |
23 | 'moderationState' => [ |
24 | ParamValidator::PARAM_REQUIRED => true, |
25 | ParamValidator::PARAM_TYPE => $this->getModerationStates(), |
26 | ], |
27 | 'reason' => [ |
28 | ParamValidator::PARAM_REQUIRED => true, |
29 | ], |
30 | 'postId' => [ |
31 | ParamValidator::PARAM_REQUIRED => true, |
32 | ], |
33 | ] + parent::getAllowedParams(); |
34 | } |
35 | |
36 | /** |
37 | * @inheritDoc |
38 | */ |
39 | protected function getExamplesMessages() { |
40 | return [ |
41 | 'action=flow&submodule=moderate-post&page=Topic:S2tycnas4hcucw8w' . |
42 | '&mppostId=050f30e34c87beebcd54080027630f57&mpmoderationState=delete&mpreason=Ahhhh' |
43 | => 'apihelp-flow+moderate-post-example-1', |
44 | ]; |
45 | } |
46 | } |