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 ApiQuery; |
| 6 | use MediaWiki\Api\ApiQueryBase; |
| 7 | use MediaWiki\Title\Title; |
| 8 | |
| 9 | class ApiQueryPropFlowInfo extends ApiQueryBase { |
| 10 | |
| 11 | public function __construct( ApiQuery $query, string $moduleName ) { |
| 12 | parent::__construct( $query, $moduleName, 'fli' ); |
| 13 | } |
| 14 | |
| 15 | /** |
| 16 | * Use action=query&prop=info instead; check for 'contentmodel' 'flow-board'. |
| 17 | * @return bool |
| 18 | */ |
| 19 | public function isDeprecated() { |
| 20 | return true; |
| 21 | } |
| 22 | |
| 23 | public function execute() { |
| 24 | $pageSet = $this->getPageSet(); |
| 25 | foreach ( $pageSet->getGoodPages() as $pageId => $page ) { |
| 26 | $pageInfo = [ 'flow' => [] ]; |
| 27 | if ( Title::newFromPageIdentity( $page )->hasContentModel( CONTENT_MODEL_FLOW_BOARD ) ) { |
| 28 | $pageInfo['flow']['enabled'] = ''; |
| 29 | } |
| 30 | $this->addPageSubItems( $pageId, $pageInfo ); |
| 31 | } |
| 32 | } |
| 33 | |
| 34 | /** |
| 35 | * @inheritDoc |
| 36 | */ |
| 37 | protected function getExamplesMessages() { |
| 38 | return [ |
| 39 | 'action=query&prop=flowinfo&titles=Talk:Sandbox|Main_Page|Talk:Flow' |
| 40 | => 'apihelp-query+flowinfo-example-1', |
| 41 | ]; |
| 42 | } |
| 43 | |
| 44 | public function getHelpUrls() { |
| 45 | return 'https://www.mediawiki.org/wiki/Special:MyLanguage/Extension:Flow/API#action.3Dquery.26prop.3Dflowinfo'; |
| 46 | } |
| 47 | |
| 48 | } |