Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
| Total | |
0.00% |
0 / 6 |
|
0.00% |
0 / 1 |
CRAP | |
0.00% |
0 / 1 |
| ArticleCompileCategoryCount | |
0.00% |
0 / 6 |
|
0.00% |
0 / 1 |
12 | |
0.00% |
0 / 1 |
| compile | |
0.00% |
0 / 6 |
|
0.00% |
0 / 1 |
12 | |||
| 1 | <?php |
| 2 | |
| 3 | namespace MediaWiki\Extension\PageTriage\ArticleCompile; |
| 4 | |
| 5 | /** |
| 6 | * Article category count |
| 7 | */ |
| 8 | class ArticleCompileCategoryCount extends ArticleCompile { |
| 9 | |
| 10 | /** @inheritDoc */ |
| 11 | public function compile() { |
| 12 | foreach ( $this->mPageId as $pageId ) { |
| 13 | $parserOutput = $this->getParserOutputByPageId( $pageId ); |
| 14 | if ( $parserOutput ) { |
| 15 | $this->metadata[$pageId]['category_count'] = count( $parserOutput->getCategoryNames() ); |
| 16 | } |
| 17 | } |
| 18 | $this->fillInZeroCount( 'category_count' ); |
| 19 | return true; |
| 20 | } |
| 21 | |
| 22 | } |