Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
Total | |
0.00% |
0 / 13 |
|
0.00% |
0 / 5 |
CRAP | |
0.00% |
0 / 1 |
ApiQueryPropFlowInfo | |
0.00% |
0 / 13 |
|
0.00% |
0 / 5 |
56 | |
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 / 6 |
|
0.00% |
0 / 1 |
12 | |||
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 | foreach ( $pageSet->getGoodPages() as $pageId => $page ) { |
25 | $pageInfo = [ 'flow' => [] ]; |
26 | if ( Title::newFromPageIdentity( $page )->hasContentModel( CONTENT_MODEL_FLOW_BOARD ) ) { |
27 | $pageInfo['flow']['enabled'] = ''; |
28 | } |
29 | $this->addPageSubItems( $pageId, $pageInfo ); |
30 | } |
31 | } |
32 | |
33 | /** |
34 | * @inheritDoc |
35 | */ |
36 | protected function getExamplesMessages() { |
37 | return [ |
38 | 'action=query&prop=flowinfo&titles=Talk:Sandbox|Main_Page|Talk:Flow' |
39 | => 'apihelp-query+flowinfo-example-1', |
40 | ]; |
41 | } |
42 | |
43 | public function getHelpUrls() { |
44 | return 'https://www.mediawiki.org/wiki/Special:MyLanguage/Extension:Flow/API#action.3Dquery.26prop.3Dflowinfo'; |
45 | } |
46 | |
47 | } |