Fomafix has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/312844

Change subject: Use [] instead of array() syntax in PHP
......................................................................

Use [] instead of array() syntax in PHP

Also fix some missing whitespaces.

Change-Id: I4e833c528f353d03fc8d268c94773d12ed9d33f8
---
M OpenIDConnect.php
M SelectOpenIDConnectIssuer.alias.php
M SelectOpenIDConnectIssuer.php
3 files changed, 47 insertions(+), 47 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/OpenIDConnect 
refs/changes/44/312844/1

diff --git a/OpenIDConnect.php b/OpenIDConnect.php
index dbc8e32..54aec35 100644
--- a/OpenIDConnect.php
+++ b/OpenIDConnect.php
@@ -73,11 +73,11 @@
 
                                        if ( !isset( $config['clientID'] ) ||
                                                !isset( $config['clientsecret'] 
) ) {
-                                               wfDebug("OpenID Connect: 
clientID or clientsecret not set for " . $iss);
-                                               $params = array(
+                                               wfDebug( "OpenID Connect: 
clientID or clientsecret not set for " . $iss );
+                                               $params = [
                                                        "uri" => urlencode( 
$_SERVER['REQUEST_URI'] ),
                                                        "query" => urlencode( 
$_SERVER['QUERY_STRING'] )
-                                               );
+                                               ];
                                                self::redirect( 
"Special:SelectOpenIDConnectIssuer",
                                                        $params, true );
                                                return false;
@@ -107,17 +107,17 @@
 
                                        if ( !isset( $config['clientID'] ) ||
                                                !isset( $config['clientsecret'] 
) ) {
-                                               wfDebug("OpenID Connect: 
clientID or clientsecret not set for " .
-                                                       $iss);
+                                               wfDebug( "OpenID Connect: 
clientID or clientsecret not set for " .
+                                                       $iss );
                                                return false;
                                        }
 
                                } else {
 
-                                       $params = array(
+                                       $params = [
                                                "uri" => urlencode( 
$_SERVER['REQUEST_URI'] ),
                                                "query" => urlencode( 
$_SERVER['QUERY_STRING'] )
-                                       );
+                                       ];
                                        self::redirect( 
"Special:SelectOpenIDConnectIssuer",
                                                $params, true );
                                        return false;
@@ -129,7 +129,7 @@
 
                        $oidc = new OpenIDConnectClient( $iss, $clientID, 
$clientsecret );
                        if ( isset( $_REQUEST['forcelogin'] ) ) {
-                               $oidc->addAuthParam( array( 'prompt' => 'login' 
) );
+                               $oidc->addAuthParam( [ 'prompt' => 'login' ] );
                        }
                        if ( isset( $config['authparam'] ) &&
                                is_array( $config['authparam'] ) ) {
@@ -196,7 +196,7 @@
        public function deauthenticate( User &$user ) {
                if ( $GLOBALS['wgOpenIDConnect_ForceLogout'] === true ) {
                        $returnto = 'Special:UserLogin';
-                       $params = array( 'forcelogin' => 'true' );
+                       $params = [ 'forcelogin' => 'true' ];
                        self::redirect( $returnto, $params );
                }
                return true;
@@ -210,23 +210,23 @@
        public function saveExtraAttributes( $id ) {
                $dbw = wfGetDB( DB_MASTER );
                $dbw->update( 'user',
-                       array( // SET
+                       [ // SET
                                'subject' => $this->subject,
                                'issuer' => $this->issuer
-                       ), array( // WHERE
+                       ], [ // WHERE
                                'user_id' => $id
-                       ), __METHOD__
+                       ], __METHOD__
                );
        }
 
        private static function getName( $subject, $issuer ) {
                $dbr = wfGetDB( DB_SLAVE );
                $row = $dbr->selectRow( 'user',
-                       array( 'user_name' ),
-                       array(
+                       [ 'user_name' ],
+                       [
                                'subject' => $subject,
                                'issuer' => $issuer
-                       ), __METHOD__
+                       ], __METHOD__
                );
                if ( $row === false ) {
                        return null;
@@ -243,12 +243,12 @@
                $username = $nt->getText();
                $dbr = wfGetDB( DB_SLAVE );
                $row = $dbr->selectRow( 'user',
-                       array( 'user_id' ),
-                       array(
+                       [ 'user_id' ],
+                       [
                                'user_name' => $username,
                                'subject' => null,
                                'issuer' => null
-                       ), __METHOD__
+                       ], __METHOD__
                );
                if ( $row === false ) {
                        return null;
@@ -312,8 +312,8 @@
                                $url = wfAppendQuery( $url, $key . '=' . $value 
);
                        }
                }
-               if ( Hooks::run( 'PluggableAuthRedirect', array( &$url ) ) ) {
-                       header('Location: ' . $url );
+               if ( Hooks::run( 'PluggableAuthRedirect', [ &$url ] ) ) {
+                       header( 'Location: ' . $url );
                        if ( $doExit ) {
                                exit;
                        }
diff --git a/SelectOpenIDConnectIssuer.alias.php 
b/SelectOpenIDConnectIssuer.alias.php
index 595eb12..5d9f8cd 100644
--- a/SelectOpenIDConnectIssuer.alias.php
+++ b/SelectOpenIDConnectIssuer.alias.php
@@ -23,24 +23,24 @@
  */
 // @codingStandardsIgnoreFile
 
-$specialPageAliases = array();
+$specialPageAliases = [];
 
 /** English (English) */
-$specialPageAliases['en'] = array(
-       'SelectOpenIDConnectIssuer' => array( 'SelectOpenIDConnectIssuer', 
'Select OpenID Connect Issuer' ),
-);
+$specialPageAliases['en'] = [
+       'SelectOpenIDConnectIssuer' => [ 'SelectOpenIDConnectIssuer', 'Select 
OpenID Connect Issuer' ],
+];
 
 /** Arabic (العربية) */
-$specialPageAliases['ar'] = array(
-       'SelectOpenIDConnectIssuer' => array( 'اختيار_متحكم_الهوية_المفتوحة' ),
-);
+$specialPageAliases['ar'] = [
+       'SelectOpenIDConnectIssuer' => [ 'اختيار_متحكم_الهوية_المفتوحة' ],
+];
 
 /** German (Deutsch) */
-$specialPageAliases['de'] = array(
-       'SelectOpenIDConnectIssuer' => array( 
'OpenID-Verbindungsherausgeber_auswählen' ),
-);
+$specialPageAliases['de'] = [
+       'SelectOpenIDConnectIssuer' => [ 
'OpenID-Verbindungsherausgeber_auswählen' ],
+];
 
 /** Simplified Chinese (中文(简体)‎) */
-$specialPageAliases['zh-hans'] = array(
-       'SelectOpenIDConnectIssuer' => array( '选择OpenID连接发行商' ),
-);
+$specialPageAliases['zh-hans'] = [
+       'SelectOpenIDConnectIssuer' => [ '选择OpenID连接发行商' ],
+];
diff --git a/SelectOpenIDConnectIssuer.php b/SelectOpenIDConnectIssuer.php
index 8a6353e..9fc3979 100644
--- a/SelectOpenIDConnectIssuer.php
+++ b/SelectOpenIDConnectIssuer.php
@@ -55,8 +55,8 @@
                                $urlbase .= "&query=" . urlencode( 
$_REQUEST['query'] );
                                $urlbase .= "&iss=";
 
-                               $html = Html::openElement( 'div', array(
-                                       'style' => 'text-align:center' )
+                               $html = Html::openElement( 'div', [
+                                       'style' => 'text-align:center' ]
                                );
                                $html .= Html::openElement( 'table' );
                                $html .= Html::openElement( 'tr' );
@@ -64,19 +64,19 @@
 
                                foreach ( $GLOBALS['wgOpenIDConnect_Config'] as 
$iss => $data ) {
                                        $html = Html::openElement( 'td' );
-                                       $html .= Html::openElement( 'table', 
array(
-                                               'style' => 'padding:20px;' )
+                                       $html .= Html::openElement( 'table', [
+                                               'style' => 'padding:20px;' ]
                                        );
                                        $html .= Html::openElement( 'tr' );
                                        if ( isset( $data['icon'] ) ) {
-                                               $html .= Html::openElement( 
'td', array(
-                                                       'style' => 
'text-align:center;' )
+                                               $html .= Html::openElement( 
'td', [
+                                                       'style' => 
'text-align:center;' ]
                                                );
-                                               $html .= Html::openElement( 
'a', array(
-                                                       'href' => $urlbase . 
$iss )
+                                               $html .= Html::openElement( 
'a', [
+                                                       'href' => $urlbase . 
$iss ]
                                                );
-                                               $html .= Html::openElement( 
'img', array(
-                                                       'src' => $data['icon'] )
+                                               $html .= Html::openElement( 
'img', [
+                                                       'src' => $data['icon'] ]
                                                );
                                                $html .= Html::closeElement( 
'img' );
                                                $html .= Html::closeElement( 
'a' );
@@ -84,11 +84,11 @@
                                                $html .= Html::closeElement( 
'tr' );
                                                $html .= Html::openElement( 
'tr' );
                                        }
-                                       $html .= Html::openElement( 'td', array(
-                                               'style' => 'text-align:center;' 
)
+                                       $html .= Html::openElement( 'td', [
+                                               'style' => 'text-align:center;' 
]
                                        );
-                                       $html .= Html::openElement( 'a', array(
-                                               'href' => $urlbase . $iss )
+                                       $html .= Html::openElement( 'a', [
+                                               'href' => $urlbase . $iss ]
                                        );
                                        if ( isset( $data['name'] ) ) {
                                                $html .= $data['name'];

-- 
To view, visit https://gerrit.wikimedia.org/r/312844
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I4e833c528f353d03fc8d268c94773d12ed9d33f8
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/OpenIDConnect
Gerrit-Branch: master
Gerrit-Owner: Fomafix <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to