totalsLookup = $totalsLookup; $this->database = $database; } /** * Add totals to output */ public function execute() { $totals = $this->totalsLookup->getTotals( $this->database ); ApiResult::setArrayType( $totals, 'assoc' ); $this->getResult()->addValue( [ 'query', 'linterstats' ], 'totals', $totals ); } /** @inheritDoc */ public function getExamplesMessages() { return [ 'action=query&meta=linterstats' => 'apihelp-query+linterstats-example-1', ]; } }