Updates for CodeSniffer and other tests

Change-Id: Ief70f6b82ed9c10d658eaeb980b0a4e780de9ac2
This commit is contained in:
Siebrand Mazeland 2016-02-17 15:57:15 +01:00
parent 627050be10
commit 66cf8c80f0
6 changed files with 32 additions and 28 deletions

View file

@ -9,14 +9,14 @@ if ( !defined( 'MEDIAWIKI' ) ) {
exit( 1 );
}
$wgExtensionCredits['specialpage'][] = array(
$wgExtensionCredits['specialpage'][] = [
'path' => __FILE__,
'name' => 'Contribution Scores',
'url' => 'https://www.mediawiki.org/wiki/Extension:Contribution_Scores',
'author' => 'Tim Laqua',
'descriptionmsg' => 'contributionscores-desc',
'version' => '1.23.0'
);
'version' => '1.25.0'
];
define( 'CONTRIBUTIONSCORES_MAXINCLUDELIMIT', 50 );
$wgContribScoreReports = null;
@ -67,19 +67,19 @@ function efContributionScores_Render( &$parser, $usertext, $metric = 'score' ) {
if ( $metric == 'score' ) {
$res = $dbr->select( 'revision',
'COUNT(DISTINCT rev_page)+SQRT(COUNT(rev_id)-COUNT(DISTINCT rev_page))*2 AS wiki_rank',
array( 'rev_user' => $user->getID() ) );
[ 'rev_user' => $user->getID() ] );
$row = $dbr->fetchObject( $res );
$output = $wgLang->formatNum( round( $row->wiki_rank, 0 ) );
} elseif ( $metric == 'changes' ) {
$res = $dbr->select( 'revision',
'COUNT(rev_id) AS rev_count',
array( 'rev_user' => $user->getID() ) );
[ 'rev_user' => $user->getID() ] );
$row = $dbr->fetchObject( $res );
$output = $wgLang->formatNum( $row->rev_count );
} elseif ( $metric == 'pages' ) {
$res = $dbr->select( 'revision',
'COUNT(DISTINCT rev_page) AS page_count',
array( 'rev_user' => $user->getID() ) );
[ 'rev_user' => $user->getID() ] );
$row = $dbr->fetchObject( $res );
$output = $wgLang->formatNum( $row->page_count );
} else {