jenkins-bot has submitted this change and it was merged.
Change subject: Add php code sniffer
......................................................................
Add php code sniffer
Use __DIR__ instead.
Change-Id: I8673f79136e3715901ab5cb104e3ce0981ac3397
---
M ConfirmAccount.php
M ConfirmAccount.setup.php
M backend/ConfirmAccount.class.php
M backend/UserAccountRequest.php
M backend/schema/ConfirmAccountUpdater.hooks.php
M business/AccountConfirmSubmission.php
M business/AccountRequestSubmission.php
M composer.json
M frontend/ConfirmAccountUI.hooks.php
M frontend/ConfirmAccountUI.setup.php
M frontend/language/ConfirmAccount.alias.php
M frontend/specialpages/actions/ConfirmAccount_body.php
M frontend/specialpages/actions/RequestAccount_body.php
M frontend/specialpages/actions/UserCredentials_body.php
A phpcs.xml
15 files changed, 207 insertions(+), 82 deletions(-)
Approvals:
Jforrester: Looks good to me, approved
jenkins-bot: Verified
diff --git a/ConfirmAccount.php b/ConfirmAccount.php
index 8ea3479..8f01fb2 100644
--- a/ConfirmAccount.php
+++ b/ConfirmAccount.php
@@ -20,7 +20,7 @@
if ( !defined( 'MEDIAWIKI' ) ) {
echo "ConfirmAccount extension\n";
- exit( 1 ) ;
+ exit( 1 );
}
$wgExtensionCredits['specialpage'][] = array(
@@ -33,11 +33,13 @@
);
# Load default config variables
-require( dirname( __FILE__ ) . '/ConfirmAccount.config.php' );
+require ( __DIR__ . '/ConfirmAccount.config.php' );
# Define were PHP files and i18n files are located
-require( dirname( __FILE__ ) . '/ConfirmAccount.setup.php' );
-ConfirmAccountSetup::defineSourcePaths( $wgAutoloadClasses, $wgMessagesDirs,
$wgExtensionMessagesFiles );
+require ( __DIR__ . '/ConfirmAccount.setup.php' );
+ConfirmAccountSetup::defineSourcePaths(
+ $wgAutoloadClasses, $wgMessagesDirs, $wgExtensionMessagesFiles
+);
# Define JS/CSS modules and file locations
ConfirmAccountUISetup::defineResourceModules( $wgResourceModules );
@@ -77,6 +79,6 @@
# Otherwise users can't get their passwords...
if ( !$wgEnableEmail ) {
echo "ConfirmAccount extension requires \$wgEnableEmail set to
true.\n";
- exit( 1 ) ;
+ exit( 1 );
}
}
diff --git a/ConfirmAccount.setup.php b/ConfirmAccount.setup.php
index 42ccd49..845b1c8 100644
--- a/ConfirmAccount.setup.php
+++ b/ConfirmAccount.setup.php
@@ -12,8 +12,10 @@
* @param $messagesFiles Array $messagesFiles
* @return void
*/
- public static function defineSourcePaths( array &$classes, array
&$messagesDirs, array &$messagesFiles ) {
- $dir = dirname( __FILE__ );
+ public static function defineSourcePaths(
+ array &$classes, array &$messagesDirs, array &$messagesFiles
+ ) {
+ $dir = __DIR__;
# Basic directory layout
$backendDir = "$dir/backend";
diff --git a/backend/ConfirmAccount.class.php b/backend/ConfirmAccount.class.php
index 70b3149..8ccfafa 100644
--- a/backend/ConfirmAccount.class.php
+++ b/backend/ConfirmAccount.class.php
@@ -1,4 +1,5 @@
<?php
+
class ConfirmAccount {
/**
* Move old stale requests to rejected list. Delete old rejected
requests.
@@ -114,8 +115,8 @@
$ip,
$user->getName(),
$url,
- $wgContLang->timeanddate( $expiration, false ) ,
- $wgContLang->date( $expiration, false ) ,
+ $wgContLang->timeanddate( $expiration, false ),
+ $wgContLang->date( $expiration, false ),
$wgContLang->time( $expiration, false )
)->inLanguage( $lang )->text()
);
@@ -217,7 +218,7 @@
$mime = $magic->guessMimeType( $tmpfile, false );
# check mime type, if desired
if ( $wgVerifyMimeType ) {
- wfDebug ( "\n\nmime: <$mime> extension:
<$extension>\n\n" );
+ wfDebug( "\n\nmime: <$mime> extension:
<$extension>\n\n" );
# Check mime type against file extension
if ( !UploadBase::verifyExtension( $mime, $extension )
) {
return Status::newFatal( 'uploadcorrupt' );
diff --git a/backend/UserAccountRequest.php b/backend/UserAccountRequest.php
index 8e07270..ffb242e 100644
--- a/backend/UserAccountRequest.php
+++ b/backend/UserAccountRequest.php
@@ -28,7 +28,8 @@
protected $user;
protected $comment;
- private function __construct() {}
+ private function __construct() {
+ }
/**
* @param $row
diff --git a/backend/schema/ConfirmAccountUpdater.hooks.php
b/backend/schema/ConfirmAccountUpdater.hooks.php
index 54e6d31..0127638 100755
--- a/backend/schema/ConfirmAccountUpdater.hooks.php
+++ b/backend/schema/ConfirmAccountUpdater.hooks.php
@@ -9,32 +9,60 @@
* @return bool
*/
public static function addSchemaUpdates( DatabaseUpdater $updater ) {
- $base = dirname( __FILE__ );
+ $base = __DIR__;
if ( $updater->getDB()->getType() == 'mysql' ||
$updater->getDB()->getType() == 'sqlite' ) {
$base = "$base/mysql";
$updater->addExtensionTable( 'account_requests',
"$base/ConfirmAccount.sql" );
- $updater->addExtensionField( 'account_requests',
'acr_filename', "$base/patch-acr_filename.sql" );
+ $updater->addExtensionField(
+ 'account_requests', 'acr_filename',
"$base/patch-acr_filename.sql"
+ );
$updater->addExtensionTable( 'account_credentials',
"$base/patch-account_credentials.sql" );
$updater->addExtensionField( 'account_requests',
'acr_areas', "$base/patch-acr_areas.sql" );
- $updater->modifyExtensionField( 'account_requests',
'acr_email', "$base/patch-acr_email-varchar.sql" );
+ $updater->modifyExtensionField(
+ 'account_requests', 'acr_email',
"$base/patch-acr_email-varchar.sql"
+ );
$updater->addExtensionIndex( 'account_requests',
'acr_email', "$base/patch-email-index.sql" );
$updater->addExtensionField( 'account_requests',
'acr_agent', "$base/patch-acr_agent.sql" );
- $updater->dropExtensionIndex( 'account_requests',
'acr_deleted_reg', "$base/patch-drop-acr_deleted_reg-index.sql" );
+ $updater->dropExtensionIndex(
+ 'account_requests', 'acr_deleted_reg',
"$base/patch-drop-acr_deleted_reg-index.sql"
+ );
} elseif ( $updater->getDB()->getType() == 'postgres' ) {
$base = "$base/postgres";
- $updater->addExtensionUpdate( array( 'addTable',
'account_requests', "$base/ConfirmAccount.pg.sql", true ) );
- $updater->addExtensionUpdate( array( 'addPgField',
'account_requests', 'acr_held', "TIMESTAMPTZ" ) );
- $updater->addExtensionUpdate( array( 'addPgField',
'account_requests', 'acr_filename', "TEXT" ) );
- $updater->addExtensionUpdate( array( 'addPgField',
'account_requests', 'acr_storage_key', "TEXT" ) );
- $updater->addExtensionUpdate( array( 'addPgField',
'account_requests', 'acr_comment', "TEXT NOT NULL DEFAULT ''" ) );
- $updater->addExtensionUpdate( array( 'addPgField',
'account_requests', 'acr_type', "INTEGER NOT NULL DEFAULT 0" ) );
- $updater->addExtensionUpdate( array( 'addTable',
'account_credentials', "$base/patch-account_credentials.sql", true ) );
- $updater->addExtensionUpdate( array( 'addPgField',
'account_requests', 'acr_areas', "TEXT" ) );
- $updater->addExtensionUpdate( array( 'addPgField',
'account_credentials', 'acd_areas', "TEXT" ) );
- $updater->addExtensionUpdate( array( 'addIndex',
'account_requests', 'acr_email', "$base/patch-email-index.sql", true ) );
- $updater->addExtensionUpdate( array( 'addPgField',
'account_requests', 'acr_agent', "$base/patch-acr_agent.sql", true ) );
+ $updater->addExtensionUpdate(
+ array( 'addTable', 'account_requests',
"$base/ConfirmAccount.pg.sql", true )
+ );
+ $updater->addExtensionUpdate(
+ array( 'addPgField', 'account_requests',
'acr_held', "TIMESTAMPTZ" )
+ );
+ $updater->addExtensionUpdate(
+ array( 'addPgField', 'account_requests',
'acr_filename', "TEXT" )
+ );
+ $updater->addExtensionUpdate(
+ array( 'addPgField', 'account_requests',
'acr_storage_key', "TEXT" )
+ );
+ $updater->addExtensionUpdate(
+ array( 'addPgField', 'account_requests',
'acr_comment', "TEXT NOT NULL DEFAULT ''" )
+ );
+ $updater->addExtensionUpdate(
+ array( 'addPgField', 'account_requests',
'acr_type', "INTEGER NOT NULL DEFAULT 0" )
+ );
+ $updater->addExtensionUpdate(
+ array( 'addTable', 'account_credentials',
"$base/patch-account_credentials.sql", true )
+ );
+ $updater->addExtensionUpdate(
+ array( 'addPgField', 'account_requests',
'acr_areas', "TEXT" )
+ );
+ $updater->addExtensionUpdate(
+ array( 'addPgField', 'account_credentials',
'acd_areas', "TEXT" )
+ );
+ $updater->addExtensionUpdate(
+ array( 'addIndex', 'account_requests',
'acr_email', "$base/patch-email-index.sql", true )
+ );
+ $updater->addExtensionUpdate(
+ array( 'addPgField', 'account_requests',
'acr_agent', "$base/patch-acr_agent.sql", true )
+ );
}
return true;
}
diff --git a/business/AccountConfirmSubmission.php
b/business/AccountConfirmSubmission.php
index 47a3289..451ceab 100644
--- a/business/AccountConfirmSubmission.php
+++ b/business/AccountConfirmSubmission.php
@@ -89,7 +89,9 @@
if ( !$result->isOk() ) {
$dbw->rollback();
return array( 'accountconf_mailerror',
- $context->msg( 'mailerror'
)->rawParams( $context->getOutput()->parse( $result->getWikiText() ) )->text()
);
+ $context->msg( 'mailerror' )->rawParams(
+
$context->getOutput()->parse( $result->getWikiText() )
+ )->text() );
}
# Clear cache for notice of how many account requests
there are
ConfirmAccount::clearAccountRequestCountCache();
@@ -106,7 +108,9 @@
# Pointless without a summary...
if ( $this->reason == '' ) {
- return array( 'accountconf_needreason', $context->msg(
'confirmaccount-needreason' )->escaped() );
+ return array(
+ 'accountconf_needreason', $context->msg(
'confirmaccount-needreason' )->escaped()
+ );
}
$dbw = wfGetDB( DB_MASTER );
@@ -122,12 +126,16 @@
# Send out a request hold email...
$result = $u->sendMail(
$context->msg( 'confirmaccount-email-subj'
)->inContentLanguage()->text(),
- $context->msg( 'confirmaccount-email-body5',
$u->getName(), $this->reason )->inContentLanguage()->text()
+ $context->msg(
+ 'confirmaccount-email-body5', $u->getName(),
$this->reason
+ )->inContentLanguage()->text()
);
if ( !$result->isOk() ) {
$dbw->rollback();
return array( 'accountconf_mailerror',
- $context->msg( 'mailerror' )->rawParams(
$context->getOutput()->parse( $result->getWikiText() ) )->text() );
+ $context->msg( 'mailerror' )->rawParams(
+ $context->getOutput()->parse(
$result->getWikiText() )
+ )->text() );
}
# Clear cache for notice of how many account requests there are
@@ -138,7 +146,7 @@
}
protected function acceptRequest( IContextSource $context ) {
- global $wgAuth, $wgAccountRequestTypes,
$wgConfirmAccountSaveInfo;
+ global $wgAuth, $wgConfirmAccountSaveInfo;
global $wgConfirmAccountRequestFormItems,
$wgConfirmAccountFSRepos;
$formConfig = $wgConfirmAccountRequestFormItems; // convience
diff --git a/business/AccountRequestSubmission.php
b/business/AccountRequestSubmission.php
index 5e765c9..2544609 100644
--- a/business/AccountRequestSubmission.php
+++ b/business/AccountRequestSubmission.php
@@ -67,8 +67,7 @@
* @return array( true or error key string, html error msg or null )
*/
public function submit( IContextSource $context ) {
- global $wgAuth, $wgAccountRequestThrottle, $wgMemc, $wgContLang;
- global $wgConfirmAccountRequestFormItems;
+ global $wgAuth, $wgAccountRequestThrottle, $wgMemc,
$wgConfirmAccountRequestFormItems;
$formConfig = $wgConfirmAccountRequestFormItems; // convience
$reqUser = $this->requester;
diff --git a/composer.json b/composer.json
index f2883f7..4365e8a 100644
--- a/composer.json
+++ b/composer.json
@@ -1,10 +1,12 @@
{
"require-dev": {
- "jakub-onderka/php-parallel-lint": "0.9"
+ "jakub-onderka/php-parallel-lint": "0.9",
+ "mediawiki/mediawiki-codesniffer": "0.4.0"
},
"scripts": {
"test": [
- "parallel-lint . --exclude vendor"
+ "parallel-lint . --exclude vendor",
+ "phpcs -p -s"
]
}
}
diff --git a/frontend/ConfirmAccountUI.hooks.php
b/frontend/ConfirmAccountUI.hooks.php
index de851d8..4866596 100644
--- a/frontend/ConfirmAccountUI.hooks.php
+++ b/frontend/ConfirmAccountUI.hooks.php
@@ -24,7 +24,9 @@
* @param $skin
* @return bool
*/
- public static function setRequestLoginLinks( array &$personal_urls,
Title $title, SkinTemplate $skin ) {
+ public static function setRequestLoginLinks(
+ array &$personal_urls, Title $title, SkinTemplate $skin
+ ) {
# Add a link to Special:RequestAccount if a link exists for
login
if ( isset( $personal_urls['login'] ) ) {
$personal_urls['createaccount'] = array(
diff --git a/frontend/ConfirmAccountUI.setup.php
b/frontend/ConfirmAccountUI.setup.php
index 878a559..afadff4 100644
--- a/frontend/ConfirmAccountUI.setup.php
+++ b/frontend/ConfirmAccountUI.setup.php
@@ -39,7 +39,7 @@
public static function defineResourceModules( array &$modules ) {
$modules['ext.confirmAccount'] = array(
'styles' => 'confirmaccount.css',
- 'localBasePath' => dirname( __FILE__ ) . '/modules',
+ 'localBasePath' => __DIR__ . '/modules',
'remoteExtPath' => 'ConfirmAccount/frontend/modules',
);
}
diff --git a/frontend/language/ConfirmAccount.alias.php
b/frontend/language/ConfirmAccount.alias.php
index fc71899..daabaff 100644
--- a/frontend/language/ConfirmAccount.alias.php
+++ b/frontend/language/ConfirmAccount.alias.php
@@ -487,4 +487,4 @@
'RequestAccount' => array( '請求帳號' ),
'ConfirmAccounts' => array( '確認帳號' ),
'UserCredentials' => array( '使用者憑證' ),
-);
\ No newline at end of file
+);
diff --git a/frontend/specialpages/actions/ConfirmAccount_body.php
b/frontend/specialpages/actions/ConfirmAccount_body.php
index 925f376..c44dafd 100644
--- a/frontend/specialpages/actions/ConfirmAccount_body.php
+++ b/frontend/specialpages/actions/ConfirmAccount_body.php
@@ -274,8 +274,10 @@
if ( $adminId ) {
$out->addHTML( '<p><b>' . $this->msg(
'confirmaccount-reject',
User::whoIs( $adminId ), $datim, $date,
$time )->parse() . '</b></p>' );
- $out->addHTML( '<p><strong>' . $this->msg(
'confirmaccount-rational' )->escaped() . '</strong><i> ' .
- $reason . '</i></p>' );
+ $out->addHTML(
+ '<p><strong>' . $this->msg(
'confirmaccount-rational' )->escaped() . '</strong><i> ' .
+ $reason . '</i></p>'
+ );
} else {
$out->addHTML( "<p><i> $reason </i></p>" );
}
@@ -286,18 +288,22 @@
$out->addHTML( '<p><b>' . $this->msg(
'confirmaccount-held',
User::whoIs( $adminId ), $datim, $date, $time
)->parse() . '</b></p>' );
- $out->addHTML( '<p><strong>' . $this->msg(
'confirmaccount-rational' )->escaped() . '</strong><i> ' .
- $reason . '</i></p>' );
+ $out->addHTML(
+ '<p><strong>' . $this->msg(
'confirmaccount-rational' )->escaped() . '</strong><i> ' .
+ $reason . '</i></p>'
+ );
}
- $form = Xml::openElement( 'form', array( 'method' => 'post',
'name' => 'accountconfirm',
+ $form = Xml::openElement( 'form', array( 'method' => 'post',
'name' => 'accountconfirm',
'action' => $titleObj->getLocalUrl() ) );
$form .= "<fieldset>";
$form .= '<legend>' . $this->msg( 'confirmaccount-leg-user'
)->escaped() . '</legend>';
$form .= '<table style="padding:4px;">';
$form .= "<tr><td>" . Xml::label( $this->msg( 'username'
)->text(), 'wpNewName' ) . "</td>";
- $form .= "<td>" . Xml::input( 'wpNewName', 30,
$this->reqUsername, array( 'id' => 'wpNewName' ) ) . "</td></tr>\n";
+ $form .= "<td>" . Xml::input( 'wpNewName', 30,
$this->reqUsername, array(
+ 'id' => 'wpNewName'
+ ) ) . "</td></tr>\n";
$econf = '';
if ( $accountReq->getEmailAuthTimestamp() ) {
$econf = ' <strong>' . $this->msg(
'confirmaccount-econf' )->escaped() . '</strong>';
@@ -306,10 +312,14 @@
$form .= "<td>" . htmlspecialchars( $accountReq->getEmail() ) .
$econf . "</td></tr>\n";
if ( count( $wgAccountRequestTypes ) > 1 ) {
$options = array();
- $form .= "<tr><td><strong>" . $this->msg(
'confirmaccount-reqtype' )->escaped() . "</strong></td><td>";
+ $form .= "<tr><td><strong>" . $this->msg(
+ 'confirmaccount-reqtype'
+ )->escaped() . "</strong></td><td>";
foreach ( $wgAccountRequestTypes as $i => $params ) {
// Give grep a chance to find the usages:
confirmaccount-pos-0, confirmaccount-pos-1
- $options[] = Xml::option( $this->msg(
"confirmaccount-pos-$i" )->text(), $i, ( $i == $this->reqType ) );
+ $options[] = Xml::option( $this->msg(
+ "confirmaccount-pos-$i"
+ )->text(), $i, ( $i == $this->reqType ) );
}
$form .= Xml::openElement( 'select', array( 'name' =>
"wpType" ) );
$form .= implode( "\n", $options );
@@ -324,7 +334,8 @@
$form .= '<legend>' . $this->msg(
'confirmaccount-leg-areas' )->escaped() . '</legend>';
$form .= "<div style='height:150px; overflow:scroll;
background-color:#f9f9f9;'>";
- $form .= "<table style='border-spacing:5px; padding:0;
background-color:#f9f9f9;'><tr style='vertical-align:top;'>";
+ $form .= "<table style='border-spacing: 5px; padding:
0; background-color: #f9f9f9;'>
+ <tr style='vertical-align:top;'>";
$count = 0;
foreach ( $userAreas as $name => $conf ) {
$count++;
@@ -360,7 +371,8 @@
}
if ( $this->hasItem( 'Biography' ) ) {
$form .= "<p>" . $this->msg(
'confirmaccount-bio' )->escaped() . "\n";
- $form .= "<textarea tabindex='1'
name='wpNewBio' id='wpNewBio' rows='12' cols='80' style='width:100%;
background-color:#f9f9f9;'>" .
+ $form .= "<textarea tabindex='1'
name='wpNewBio' id='wpNewBio' rows='12'
+ cols='80' style='width: 100%;
background-color: #f9f9f9;'>" .
htmlspecialchars( $this->reqBio ) .
"</textarea></p>\n";
}
@@ -382,7 +394,8 @@
}
if ( $this->hasItem( 'Notes' ) ) {
$form .= "</p><p>" . $this->msg(
'confirmaccount-notes' )->escaped() . "\n";
- $form .= "<textarea tabindex='1'
readonly='readonly' name='wpNotes' id='wpNotes' rows='3' cols='80'
style='width:100%'>" .
+ $form .= "<textarea tabindex='1'
readonly='readonly' name='wpNotes'
+ id='wpNotes' rows='3' cols='80'
style='width: 100%'>" .
htmlspecialchars(
$accountReq->getNotes() ) .
"</textarea></p>\n";
}
@@ -428,20 +441,42 @@
$form .= "<strong>" . $this->msg( 'confirmaccount-confirm'
)->parse() . "</strong>\n";
$form .= "<table style='padding:5px;'><tr>";
$form .= "<td>" . Xml::radio( 'wpSubmitType', 'accept',
$this->submitType == 'accept',
- array( 'id' => 'submitCreate', 'onclick' =>
'document.getElementById("wpComment").style.display="block"' ) );
- $form .= ' ' . Xml::label( $this->msg( 'confirmaccount-create'
)->text(), 'submitCreate' ) . "</td>\n";
+ array(
+ 'id' => 'submitCreate',
+ 'onclick' =>
'document.getElementById("wpComment").style.display="block"'
+ )
+ );
+ $form .= ' ' . Xml::label(
+ $this->msg( 'confirmaccount-create' )->text(),
'submitCreate'
+ ) . "</td>\n";
$form .= "<td>" . Xml::radio( 'wpSubmitType', 'reject',
$this->submitType == 'reject',
- array( 'id' => 'submitDeny', 'onclick' =>
'document.getElementById("wpComment").style.display="block"' ) );
- $form .= ' ' . Xml::label( $this->msg( 'confirmaccount-deny'
)->text(), 'submitDeny' ) . "</td>\n";
+ array(
+ 'id' => 'submitDeny', 'onclick' =>
'document.getElementById("wpComment").style.display="block"'
+ )
+ );
+ $form .= ' ' . Xml::label(
+ $this->msg( 'confirmaccount-deny' )->text(),
'submitDeny'
+ ) . "</td>\n";
$form .= "<td>" . Xml::radio( 'wpSubmitType', 'hold',
$this->submitType == 'hold',
- array( 'id' => 'submitHold', 'onclick' =>
'document.getElementById("wpComment").style.display="block"' ) );
- $form .= ' ' . Xml::label( $this->msg( 'confirmaccount-hold'
)->text(), 'submitHold' ) . "</td>\n";
+ array(
+ 'id' => 'submitHold', 'onclick' =>
'document.getElementById("wpComment").style.display="block"'
+ )
+ );
+ $form .= ' ' . Xml::label(
+ $this->msg( 'confirmaccount-hold' )->text(),
'submitHold'
+ ) . "</td>\n";
$form .= "<td>" . Xml::radio( 'wpSubmitType', 'spam',
$this->submitType == 'spam',
- array( 'id' => 'submitSpam', 'onclick' =>
'document.getElementById("wpComment").style.display="none"' ) );
- $form .= ' ' . Xml::label( $this->msg( 'confirmaccount-spam'
)->text(), 'submitSpam' ) . "</td>\n";
+ array(
+ 'id' => 'submitSpam', 'onclick' =>
'document.getElementById("wpComment").style.display="none"'
+ )
+ );
+ $form .= ' ' . Xml::label(
+ $this->msg( 'confirmaccount-spam' )->text(),
'submitSpam'
+ ) . "</td>\n";
$form .= "</tr></table>";
$form .= "<div id='wpComment'><p>" . $this->msg(
'confirmaccount-reason' )->escaped() . "</p>\n";
- $form .= "<p><textarea name='wpReason' id='wpReason' rows='3'
cols='80' style='width:80%; display=block;'>" .
+ $form .= "<p>
+ <textarea name='wpReason' id='wpReason' rows='3' cols='80'
style='width:80%; display=block;'>" .
htmlspecialchars( $this->reason ) .
"</textarea></p></div>\n";
$form .= "<p>" . Xml::submitButton( $this->msg(
'confirmaccount-submit' )->text() ) . "</p>\n";
$form .= '</fieldset>';
@@ -696,12 +731,16 @@
$datim = $this->getLanguage()->timeanddate(
wfTimestamp( TS_MW, $row->acr_rejected ), true );
$date = $this->getLanguage()->date( wfTimestamp( TS_MW,
$row->acr_rejected ), true );
$time = $this->getLanguage()->time( wfTimestamp( TS_MW,
$row->acr_rejected ), true );
- $r .= ' <b>' . $this->msg( 'confirmaccount-reject',
$row->user_name, $datim, $date, $time )->parse() . '</b>';
+ $r .= ' <b>' . $this->msg(
+ 'confirmaccount-reject', $row->user_name,
$datim, $date, $time
+ )->parse() . '</b>';
} elseif ( $row->acr_held && !$row->acr_rejected ) {
$datim = $this->getLanguage()->timeanddate(
wfTimestamp( TS_MW, $row->acr_held ), true );
$date = $this->getLanguage()->date( wfTimestamp( TS_MW,
$row->acr_held ), true );
$time = $this->getLanguage()->time( wfTimestamp( TS_MW,
$row->acr_held ), true );
- $r .= ' <b>' . $this->msg( 'confirmaccount-held',
User::whoIs( $row->acr_user ), $datim, $date, $time )->parse() . '</b>';
+ $r .= ' <b>' . $this->msg(
+ 'confirmaccount-held', User::whoIs(
$row->acr_user ), $datim, $date, $time
+ )->parse() . '</b>';
}
# Check if someone is viewing this request
$key = wfMemcKey( 'acctrequest', 'view', $row->acr_id );
@@ -710,22 +749,29 @@
$r .= ' <b>' . $this->msg( 'confirmaccount-viewing',
User::whoIs( $value ) )->parse() . '</b>';
}
- $r .= "<br /><table
class='mw-confirmaccount-body-{$this->queueType}' style='border-spacing:1px;
padding:3px; border:1px; width:100%;''>";
+ $r .= "<br /><table
class='mw-confirmaccount-body-{$this->queueType}'
+ style='border-spacing:1px; padding:3px; border:1px;
width:100%;''>";
if ( $this->hasItem( 'UserName' ) ) {
- $r .= '<tr><td><strong>' . $this->msg(
'confirmaccount-name' )->escaped() . '</strong></td><td width=\'100%\'>' .
+ $r .= '<tr><td><strong>' . $this->msg(
+ 'confirmaccount-name'
+ )->escaped() . '</strong></td><td width=\'100%\'>' .
htmlspecialchars( $row->acr_name ) .
'</td></tr>';
}
if ( $this->hasItem( 'RealName' ) ) {
$hasCV = $row->acr_filename
? ' <strong>' . $this->msg(
'confirmaccount-withcv' )->escaped() . '</strong>'
: '';
- $r .= '<tr><td><strong>' . $this->msg(
'confirmaccount-real-q' )->escaped() . '</strong></td><td width=\'100%\'>' .
+ $r .= '<tr><td><strong>' . $this->msg(
+ 'confirmaccount-real-q'
+ )->escaped() . '</strong></td><td width=\'100%\'>' .
htmlspecialchars( $row->acr_real_name ) .
$hasCV . '</td></tr>';
}
$econf = $row->acr_email_authenticated
? ' <strong>' . $this->msg( 'confirmaccount-econf'
)->escaped() . '</strong>'
: '';
- $r .= '<tr><td><strong>' . $this->msg( 'confirmaccount-email-q'
)->escaped() . '</strong></td><td width=\'100%\'>' .
+ $r .= '<tr><td><strong>' . $this->msg(
+ 'confirmaccount-email-q'
+ )->escaped() . '</strong></td><td width=\'100%\'>' .
htmlspecialchars( $row->acr_email ) . $econf .
'</td></tr>';
# Truncate this, blah blah...
$bio = htmlspecialchars( $row->acr_bio );
diff --git a/frontend/specialpages/actions/RequestAccount_body.php
b/frontend/specialpages/actions/RequestAccount_body.php
index 837af97..8d46d97 100755
--- a/frontend/specialpages/actions/RequestAccount_body.php
+++ b/frontend/specialpages/actions/RequestAccount_body.php
@@ -107,7 +107,7 @@
$out->addWikiMsg( 'requestaccount-text' );
- $form = Xml::openElement( 'form', array( 'method' => 'post',
'name' => 'accountrequest',
+ $form = Xml::openElement( 'form', array( 'method' => 'post',
'name' => 'accountrequest',
'action' => $this->getPageTitle()->getLocalUrl(),
'enctype' => 'multipart/form-data' ) );
$form .= '<fieldset><legend>' . $this->msg(
'requestaccount-leg-user' )->escaped() . '</legend>';
@@ -115,19 +115,27 @@
$form .= '<table style="padding:4px;">';
if ( $this->hasItem( 'UserName' ) ) {
$form .= "<tr><td>" . Xml::label( $this->msg(
'username' )->text(), 'wpUsername' ) . "</td>";
- $form .= "<td>" . Xml::input( 'wpUsername', 30,
$this->mUsername, array( 'id' => 'wpUsername' ) ) . "</td></tr>\n";
+ $form .= "<td>" . Xml::input(
+ 'wpUsername', 30, $this->mUsername, array( 'id'
=> 'wpUsername' )
+ ) . "</td></tr>\n";
} else {
$form .= "<tr><td>" . $this->msg( 'username'
)->escaped() . "</td>";
$form .= "<td>" . $this->msg( 'requestaccount-same'
)->escaped() . "</td></tr>\n";
}
- $form .= "<tr><td>" . Xml::label( $this->msg(
'requestaccount-email' )->text(), 'wpEmail' ) . "</td>";
- $form .= "<td>" . Xml::input( 'wpEmail', 30, $this->mEmail,
array( 'id' => 'wpEmail' ) ) . "</td></tr>\n";
+ $form .= "<tr><td>" . Xml::label(
+ $this->msg( 'requestaccount-email' )->text(), 'wpEmail'
+ ) . "</td>";
+ $form .= "<td>" . Xml::input(
+ 'wpEmail', 30, $this->mEmail, array( 'id' => 'wpEmail' )
+ ) . "</td></tr>\n";
if ( count( $wgAccountRequestTypes ) > 1 ) {
$form .= "<tr><td>" . $this->msg(
'requestaccount-reqtype' )->escaped() . "</td><td>";
$options = array();
foreach ( $wgAccountRequestTypes as $i => $params ) {
// Give grep a chance to find the usages:
requestaccount-level-0, requestaccount-level-1
- $options[] = Xml::option( $this->msg(
"requestaccount-level-$i" )->text(), $i, ( $i == $this->mType ) );
+ $options[] = Xml::option(
+ $this->msg( "requestaccount-level-$i"
)->text(), $i, ( $i == $this->mType )
+ );
}
$form .= Xml::openElement( 'select', array( 'name' =>
"wpType" ) );
$form .= implode( "\n", $options );
@@ -143,7 +151,8 @@
$form .= $this->msg( 'requestaccount-areas-text'
)->parseAsBlock() . "\n";
$form .= "<div style='height:150px; overflow:scroll;
background-color:#f9f9f9;'>";
- $form .= "<table style='border-spacing:5px;
padding:0px; background-color:#f9f9f9;'><tr valign='top'>";
+ $form .= "<table style='border-spacing: 5px; padding:
0px; background-color: #f9f9f9;'>
+ <tr valign='top'>";
$count = 0;
foreach ( $userAreas as $name => $conf ) {
$count++;
@@ -171,8 +180,12 @@
$form .= '<legend>' . $this->msg(
'requestaccount-leg-person' )->escaped() . '</legend>';
if ( $this->hasItem( 'RealName' ) ) {
$form .= '<table style="padding:4px;">';
- $form .= "<tr><td>" . Xml::label( $this->msg(
'requestaccount-real' )->text(), 'wpRealName' ) . "</td>";
- $form .= "<td>" . Xml::input( 'wpRealName', 35,
$this->mRealName, array( 'id' => 'wpRealName' ) ) . "</td></tr>\n";
+ $form .= "<tr><td>" . Xml::label(
+ $this->msg( 'requestaccount-real'
)->text(), 'wpRealName'
+ ) . "</td>";
+ $form .= "<td>" . Xml::input(
+ 'wpRealName', 35, $this->mRealName,
array( 'id' => 'wpRealName' )
+ ) . "</td></tr>\n";
$form .= '</table>';
}
if ( $this->hasItem( 'Biography' ) ) {
@@ -181,7 +194,8 @@
}
$form .= $this->msg( 'requestaccount-bio-text'
)->parseAsBlock() . "\n";
$form .= "<p>" . $this->msg(
'requestaccount-bio' )->parse() . "\n";
- $form .= "<textarea tabindex='1' name='wpBio'
id='wpBio' rows='12' cols='80' style='width:100%; background-color:#f9f9f9;'>" .
+ $form .= "<textarea tabindex='1' name='wpBio'
id='wpBio' rows='12' cols='80'
+ style='width: 100%; background-color:
#f9f9f9;'>" .
htmlspecialchars( $this->mBio ) .
"</textarea></p>\n";
}
$form .= '</fieldset>';
@@ -198,13 +212,15 @@
}
if ( $this->hasItem( 'Notes' ) ) {
$form .= "<p>" . $this->msg(
'requestaccount-notes' )->escaped() . "\n";
- $form .= "<textarea tabindex='1' name='wpNotes'
id='wpNotes' rows='3' cols='80' style='width:100%;background-color:#f9f9f9;'>" .
+ $form .= "<textarea tabindex='1' name='wpNotes'
id='wpNotes' rows='3' cols='80'
+ style='width: 100%; background-color:
#f9f9f9;'>" .
htmlspecialchars( $this->mNotes ) .
"</textarea></p>\n";
}
if ( $this->hasItem( 'Links' ) ) {
$form .= "<p>" . $this->msg(
'requestaccount-urls' )->escaped() . "\n";
- $form .= "<textarea tabindex='1' name='wpUrls'
id='wpUrls' rows='2' cols='80' style='width:100%; background-color:#f9f9f9;'>" .
+ $form .= "<textarea tabindex='1' name='wpUrls'
id='wpUrls' rows='2' cols='80'
+ style='width: 100%; background-color:
#f9f9f9;'>" .
htmlspecialchars( $this->mUrls ) .
"</textarea></p>\n";
}
diff --git a/frontend/specialpages/actions/UserCredentials_body.php
b/frontend/specialpages/actions/UserCredentials_body.php
index 5aad627..4b8d53d 100644
--- a/frontend/specialpages/actions/UserCredentials_body.php
+++ b/frontend/specialpages/actions/UserCredentials_body.php
@@ -44,7 +44,9 @@
$out = $this->getOutput();
$username = str_replace( '_', ' ', $this->target );
- $form = Xml::openElement( 'form', array( 'name' =>
'stablization', 'action' => $wgScript, 'method' => 'get' ) );
+ $form = Xml::openElement(
+ 'form', array( 'name' => 'stablization', 'action' =>
$wgScript, 'method' => 'get' )
+ );
$form .= "<fieldset><legend>" . $this->msg(
'usercredentials-leg' )->escaped() . "</legend>";
$form .= "<table><tr>";
$form .= "<td>" . Html::Hidden( 'title',
$this->getPageTitle()->getPrefixedText() ) . "</td>";
@@ -83,16 +85,21 @@
$grouplist = '';
if ( count( $list ) > 0 ) {
- $grouplist = '<tr><td>' . $this->msg(
'usercredentials-member' )->escaped() . '</td><td>' . implode( ', ', $list ) .
'</td></tr>';
+ $grouplist = '<tr><td>' . $this->msg(
+ 'usercredentials-member'
+ )->escaped() . '</td><td>' . implode( ', ', $list ) .
'</td></tr>';
}
$form = "<fieldset>";
$form .= '<legend>' . $this->msg( 'usercredentials-leg-user'
)->escaped() . '</legend>';
$form .= '<table style="padding:4px;">';
$form .= "<tr><td>" . $this->msg( 'username' )->escaped() .
"</td>";
- $form .= "<td>" . Linker::makeLinkObj( $user->getUserPage(),
htmlspecialchars( $user->getUserPage()->getText() ) ) . "</td></tr>\n";
+ $form .= "<td>" . Linker::makeLinkObj( $user->getUserPage(),
+ htmlspecialchars( $user->getUserPage()->getText() ) ) .
"</td></tr>\n";
- $econf = $row->acd_email_authenticated ? ' <strong>' .
$this->msg( 'confirmaccount-econf' )->escaped() . '</strong>' : '';
+ $econf = $row->acd_email_authenticated ? ' <strong>' .
$this->msg(
+ 'confirmaccount-econf'
+ )->escaped() . '</strong>' : '';
$form .= "<tr><td>" . $this->msg( 'usercredentials-email'
)->escaped() . "</td>";
$form .= "<td>" . htmlspecialchars( $row->acd_email ) . $econf
. "</td></tr>\n";
@@ -108,7 +115,8 @@
$form .= '<legend>' . $this->msg(
'confirmaccount-leg-areas' )->escaped() . '</legend>';
$form .= "<div style='height:150px; overflow:scroll;
background-color:#f9f9f9;'>";
- $form .= "<table style='border-spacing:5px;
padding:0px; background-color:#f9f9f9;'><tr style='vertical-align: top;'>";
+ $form .= "<table style='border-spacing: 5px; padding:
0px; background-color: #f9f9f9;'>
+ <tr style='vertical-align: top;'>";
$count = 0;
$att = array( 'disabled' => 'disabled' );
@@ -142,7 +150,8 @@
$form .= "<td>" . htmlspecialchars( $row->acd_real_name ) .
"</td></tr>\n";
$form .= '</table>';
$form .= "<p>" . $this->msg( 'usercredentials-bio' )->escaped()
. "</p>";
- $form .= "<p><textarea tabindex='1' readonly='readonly'
name='wpBio' id='wpNewBio' rows='10' cols='80' style='width:100%'>" .
+ $form .= "<p><textarea tabindex='1' readonly='readonly'
name='wpBio'
+ id='wpNewBio' rows='10' cols='80' style='width: 100%'>" .
htmlspecialchars( $row->acd_bio ) .
"</textarea></p>\n";
$form .= '</fieldset>';
@@ -158,7 +167,8 @@
$form .= $this->msg( 'confirmaccount-none-p'
)->escaped();
}
$form .= "</p><p>" . $this->msg(
'usercredentials-notes' )->escaped() . "</p>\n";
- $form .= "<p><textarea tabindex='1' readonly='readonly'
name='wpNotes' id='wpNotes' rows='3' cols='80' style='width:100%'>" .
+ $form .= "<p><textarea tabindex='1' readonly='readonly'
name='wpNotes'
+ id='wpNotes' rows='3' cols='80' style='width: 100%'>" .
htmlspecialchars( $row->acd_notes ) .
"</textarea></p>\n";
$form .= "<p>" . $this->msg( 'usercredentials-urls'
)->escaped() . "</p>\n";
diff --git a/phpcs.xml b/phpcs.xml
new file mode 100644
index 0000000..d81a292
--- /dev/null
+++ b/phpcs.xml
@@ -0,0 +1,8 @@
+<?xml version="1.0"?>
+<ruleset>
+ <rule ref="vendor/mediawiki/mediawiki-codesniffer/MediaWiki"/>
+ <file>.</file>
+ <arg name="extensions" value="php,php5,inc"/>
+ <arg name="encoding" value="utf8"/>
+ <exclude-pattern>vendor</exclude-pattern>
+</ruleset>
--
To view, visit https://gerrit.wikimedia.org/r/243242
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I8673f79136e3715901ab5cb104e3ce0981ac3397
Gerrit-PatchSet: 3
Gerrit-Project: mediawiki/extensions/ConfirmAccount
Gerrit-Branch: master
Gerrit-Owner: Paladox <[email protected]>
Gerrit-Reviewer: Aaron Schulz <[email protected]>
Gerrit-Reviewer: Hashar <[email protected]>
Gerrit-Reviewer: Jforrester <[email protected]>
Gerrit-Reviewer: Legoktm <[email protected]>
Gerrit-Reviewer: Paladox <[email protected]>
Gerrit-Reviewer: jenkins-bot <>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits