totalsLookup = $totalsLookup; $this->databaseFactory = $databaseFactory; } 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; } $lintDb = $this->databaseFactory->newDatabase( $this->title->getArticleID(), $this->title->getNamespace() ); $this->totalsLookup->updateStats( $lintDb, $lintDb->setForPage( $errors ) ); return true; } }