totalsLookup = $totalsLookup; $this->database = $database; } public function run() { if ( $this->title->getLatestRevID() != $this->params['revision'] ) { // Outdated now, let a later job handle it return true; } // [ 'id' => LintError ] $errors = []; foreach ( $this->params['errors'] as $errorInfo ) { if ( $errorInfo['type'] === 'inline-media-caption' ) { // Drop lints of this type for now continue; } $error = new LintError( $errorInfo['type'], $errorInfo['location'], $errorInfo['params'], $errorInfo['dbid'] ); // Use unique id as key to get rid of exact dupes // (e.g. same category of error in same template) $errors[$error->id()] = $error; } LoggerFactory::getInstance( 'Linter' )->debug( '{method}: Recording {numErrors} errors for {page}', [ 'method' => __METHOD__, 'numErrors' => count( $errors ), 'page' => $this->title->getPrefixedDBkey() ] ); $this->totalsLookup->updateStats( $this->database->setForPage( $this->title->getArticleID(), $this->title->getNamespace(), $errors ) ); return true; } }