Code Coverage
 
Lines
Functions and Methods
Classes and Traits
Total
0.00% covered (danger)
0.00%
0 / 16
0.00% covered (danger)
0.00%
0 / 5
CRAP
0.00% covered (danger)
0.00%
0 / 1
ApiFlowModerateTopic
0.00% covered (danger)
0.00%
0 / 16
0.00% covered (danger)
0.00%
0 / 5
30
0.00% covered (danger)
0.00%
0 / 1
 __construct
0.00% covered (danger)
0.00%
0 / 1
0.00% covered (danger)
0.00%
0 / 1
2
 getBlockParams
0.00% covered (danger)
0.00%
0 / 1
0.00% covered (danger)
0.00%
0 / 1
2
 getAction
0.00% covered (danger)
0.00%
0 / 1
0.00% covered (danger)
0.00%
0 / 1
2
 getAllowedParams
0.00% covered (danger)
0.00%
0 / 9
0.00% covered (danger)
0.00%
0 / 1
2
 getExamplesMessages
0.00% covered (danger)
0.00%
0 / 4
0.00% covered (danger)
0.00%
0 / 1
2
1<?php
2
3namespace Flow\Api;
4
5use Wikimedia\ParamValidator\ParamValidator;
6
7class ApiFlowModerateTopic extends ApiFlowBasePost {
8
9    public function __construct( $api, $modName ) {
10        parent::__construct( $api, $modName, 'mt' );
11    }
12
13    protected function getBlockParams() {
14        return [ 'topic' => $this->extractRequestParams() ];
15    }
16
17    protected function getAction() {
18        return 'moderate-topic';
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        ] + parent::getAllowedParams();
31    }
32
33    /**
34     * @inheritDoc
35     */
36    protected function getExamplesMessages() {
37        return [
38            'action=flow&submodule=moderate-topic&page=Topic:S2tycnas4hcucw8w&mtmoderationState=delete&mtreason=Ahhhh'
39                => 'apihelp-flow+moderate-topic-example-1',
40        ];
41    }
42}