jenkins-bot has submitted this change and it was merged. Change subject: Update mediawiki codesniffer ......................................................................
Update mediawiki codesniffer * Require php >= 5.5.9 * Add composer fix Change-Id: I0cb6a3ae8b46329c03c8f0972aa573fd0064a048 --- M InviteStore.php M SpecialInviteSignup.php M composer.json 3 files changed, 29 insertions(+), 28 deletions(-) Approvals: Legoktm: Looks good to me, approved jenkins-bot: Verified diff --git a/InviteStore.php b/InviteStore.php index e231a7a..ce7110c 100644 --- a/InviteStore.php +++ b/InviteStore.php @@ -23,10 +23,10 @@ } public function getInvites() { - $fields = array( '*' ); - $conds = array(); + $fields = [ '*' ]; + $conds = []; $res = $this->db->select( $this->dbTable, $fields, $conds, __METHOD__ ); - $invites = array(); + $invites = []; foreach ( $res as $row ) { $invites[] = $this->rowToArray( $row ); } @@ -38,13 +38,13 @@ global $wgSecretKey; $hash = sha1( $inviter->getId() . $wgSecretKey . $email . wfTimestamp( TS_UNIX ) ); - $data = array( + $data = [ 'is_inviter' => $inviter->getId(), 'is_email' => $email, 'is_when' => wfTimestamp( TS_UNIX ), 'is_hash' => $hash, 'is_groups' => serialize( $groups ), - ); + ]; $this->db->insert( $this->dbTable, $data, __METHOD__ ); @@ -52,29 +52,29 @@ } public function deleteInvite( $hash ) { - $conds = array( 'is_hash' => $hash ); + $conds = [ 'is_hash' => $hash ]; $this->db->delete( $this->dbTable, $conds, __METHOD__ ); } public function getInvite( $hash ) { - $fields = array( '*' ); - $conds = array( 'is_hash' => $hash ); + $fields = [ '*' ]; + $conds = [ 'is_hash' => $hash ]; $res = $this->db->selectRow( $this->dbTable, $fields, $conds, __METHOD__ ); return $this->rowToArray( $res ); } public function addSignupDate( User $user, $hash ) { - $conds = array( 'is_hash' => $hash ); - $data = array( + $conds = [ 'is_hash' => $hash ]; + $data = [ 'is_used' => wfTimestamp( TS_UNIX ), 'is_invitee' => $user->getId(), - ); + ]; $this->db->update( $this->dbTable, $data, $conds, __METHOD__ ); } protected function rowToArray( $row ) { - $array = array(); + $array = []; if ( $row === false ) { return null; } diff --git a/SpecialInviteSignup.php b/SpecialInviteSignup.php index 38e7e12..0d992aa 100644 --- a/SpecialInviteSignup.php +++ b/SpecialInviteSignup.php @@ -58,11 +58,11 @@ // Silence } elseif ( !$okay ) { $out->wrapWikiMsg( - Html::rawElement( 'div', array( 'class' => 'error' ), "$1" ), - array( 'is-invalidemail', $email ) + Html::rawElement( 'div', [ 'class' => 'error' ], "$1" ), + [ 'is-invalidemail', $email ] ); } else { - $groups = array(); + $groups = []; foreach ( $this->groups as $group ) { if ( $request->getCheck( "group-$group" ) ) { $groups[] = $group; @@ -78,7 +78,7 @@ $lang = $this->getLanguage(); $out->addHtml( - Html::openElement( 'table', array( 'class' => 'wikitable' ) ) . + Html::openElement( 'table', [ 'class' => 'wikitable' ] ) . Html::openElement( 'thead' ) . Html::openElement( 'tr' ) . Html::element( 'th', null, $this->msg( 'is-tableth-date' )->text() ) . @@ -91,7 +91,7 @@ Html::closeElement( 'thead' ) ); foreach ( $invites as $hash => $invite ) { - $whenSort = array( 'data-sort-value' => $invite['when'] ); + $whenSort = [ 'data-sort-value' => $invite['when'] ]; $when = $lang->userTimeAndDate( $invite['when'], $user ); $email = $invite['email']; $groups = $invite['groups']; @@ -113,7 +113,7 @@ Html::element( 'td', null, $email ) . Html::element( 'td', null, User::newFromId( $invite['inviter'] )->getName() ) . Html::element( 'td', - array( 'data-sort-value' => $invite['used'] ), + [ 'data-sort-value' => $invite['used'] ], $invite['used'] ? $lang->userTimeAndDate( $invite['used'], $user ) : '' ) . Html::element( 'td', null, $groups ) . @@ -128,10 +128,10 @@ } protected function getDeleteButton( $hash ) { - $attribs = array( + $attribs = [ 'method' => 'post', 'action' => $this->getPageTitle()->getLocalUrl(), - ); + ]; $form = Html::openElement( 'form', $attribs ); $form .= Html::hidden( 'title', $this->getPageTitle()->getPrefixedDBKey() ); $form .= Html::hidden( 'token', $this->getUser()->getEditToken( 'is' ) ); @@ -153,12 +153,12 @@ Html::hidden( 'do', 'add' ) . Xml::submitButton( $this->msg( 'is-add' )->text() ); - $attribs = array( + $attribs = [ 'method' => 'post', 'action' => $this->getPageTitle()->getLocalUrl(), - ); + ]; - $groupChecks = array(); + $groupChecks = []; foreach ( $this->groups as $group ) { $groupChecks[] = Xml::checkLabel( User::getGroupMember( $group ), @@ -186,7 +186,7 @@ global $wgPasswordSender; $url = Title::newFromText( 'Special:Userlogin/signup' )->getCanonicalUrl( - array( 'invite' => $hash, 'returnto' => 'Special:Dashboard' ) + [ 'invite' => $hash, 'returnto' => 'Special:Dashboard' ] ); $subj = wfMessage( 'is-emailsubj' )->inContentLanguage(); @@ -196,13 +196,13 @@ $emailTo = new MailAddress( $email ); $emailFrom = new MailAddress( $wgPasswordSender, wfMessage( 'emailsender' )->text() ); - $params = array( + $params = [ 'to' => $emailTo, 'from' => $emailFrom, 'replyto' => $emailFrom, 'body' => $body->text(), 'subj' => $subj->text(), - ); + ]; $job = new EmaillingJob( Title::newMainPage(), $params ); $job->run(); } diff --git a/composer.json b/composer.json index f0958a3..fd75c74 100644 --- a/composer.json +++ b/composer.json @@ -18,14 +18,15 @@ "issues": "https://phabricator.wikimedia.org/" }, "require": { - "php": ">=5.3.0", + "php": ">=5.5.9", "composer/installers": ">=1.0.1" }, "require-dev": { "jakub-onderka/php-parallel-lint": "0.9.2", - "mediawiki/mediawiki-codesniffer": "0.5.1" + "mediawiki/mediawiki-codesniffer": "0.6.0" }, "scripts": { + "fix": "phpcbf", "test": [ "parallel-lint . --exclude vendor", "phpcs -p -s" -- To view, visit https://gerrit.wikimedia.org/r/271221 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I0cb6a3ae8b46329c03c8f0972aa573fd0064a048 Gerrit-PatchSet: 2 Gerrit-Project: mediawiki/extensions/InviteSignup Gerrit-Branch: master Gerrit-Owner: Nikerabbit <niklas.laxst...@gmail.com> Gerrit-Reviewer: Legoktm <legoktm.wikipe...@gmail.com> Gerrit-Reviewer: jenkins-bot <> _______________________________________________ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits