Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
Total | |
0.00% |
0 / 15 |
|
0.00% |
0 / 6 |
CRAP | |
0.00% |
0 / 1 |
ApiQueryPropFlowInfo | |
0.00% |
0 / 15 |
|
0.00% |
0 / 6 |
72 | |
0.00% |
0 / 1 |
__construct | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
isDeprecated | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
execute | |
0.00% |
0 / 4 |
|
0.00% |
0 / 1 |
6 | |||
getPageInfo | |
0.00% |
0 / 4 |
|
0.00% |
0 / 1 |
6 | |||
getExamplesMessages | |
0.00% |
0 / 4 |
|
0.00% |
0 / 1 |
2 | |||
getHelpUrls | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 |
1 | <?php |
2 | |
3 | namespace Flow\Api; |
4 | |
5 | use ApiQueryBase; |
6 | use MediaWiki\Title\Title; |
7 | |
8 | class ApiQueryPropFlowInfo extends ApiQueryBase { |
9 | |
10 | public function __construct( $query, $moduleName ) { |
11 | parent::__construct( $query, $moduleName, 'fli' ); |
12 | } |
13 | |
14 | /** |
15 | * Use action=query&prop=info instead; check for 'contentmodel' 'flow-board'. |
16 | * @return bool |
17 | */ |
18 | public function isDeprecated() { |
19 | return true; |
20 | } |
21 | |
22 | public function execute() { |
23 | $pageSet = $this->getPageSet(); |
24 | /** @var Title $title */ |
25 | foreach ( $pageSet->getGoodTitles() as $pageid => $title ) { |
26 | $pageInfo = $this->getPageInfo( $title ); |
27 | $this->addPageSubItems( $pageid, $pageInfo ); |
28 | } |
29 | } |
30 | |
31 | /** |
32 | * In the future we can add more Flow related info here |
33 | * @param Title $title |
34 | * @return array |
35 | */ |
36 | protected function getPageInfo( Title $title ) { |
37 | $result = [ 'flow' => [] ]; |
38 | if ( $title->getContentModel() === CONTENT_MODEL_FLOW_BOARD ) { |
39 | $result['flow']['enabled'] = ''; |
40 | } |
41 | |
42 | return $result; |
43 | } |
44 | |
45 | /** |
46 | * @inheritDoc |
47 | */ |
48 | protected function getExamplesMessages() { |
49 | return [ |
50 | 'action=query&prop=flowinfo&titles=Talk:Sandbox|Main_Page|Talk:Flow' |
51 | => 'apihelp-query+flowinfo-example-1', |
52 | ]; |
53 | } |
54 | |
55 | public function getHelpUrls() { |
56 | return 'https://www.mediawiki.org/wiki/Special:MyLanguage/Extension:Flow/API#action.3Dquery.26prop.3Dflowinfo'; |
57 | } |
58 | |
59 | } |