Merge "Factor SpecilaPageExecutor out of SpecialPageTestBase"
[lhc/web/wiklou.git] / includes / installer / MssqlInstaller.php
index 83681b6..c6b8960 100644 (file)
@@ -29,7 +29,7 @@
  */
 class MssqlInstaller extends DatabaseInstaller {
 
  */
 class MssqlInstaller extends DatabaseInstaller {
 
-       protected $globalNames = array(
+       protected $globalNames = [
                'wgDBserver',
                'wgDBname',
                'wgDBuser',
                'wgDBserver',
                'wgDBname',
                'wgDBuser',
@@ -37,13 +37,13 @@ class MssqlInstaller extends DatabaseInstaller {
                'wgDBmwschema',
                'wgDBprefix',
                'wgDBWindowsAuthentication',
                'wgDBmwschema',
                'wgDBprefix',
                'wgDBWindowsAuthentication',
-       );
+       ];
 
 
-       protected $internalDefaults = array(
+       protected $internalDefaults = [
                '_InstallUser' => 'sa',
                '_InstallWindowsAuthentication' => 'sqlauth',
                '_WebWindowsAuthentication' => 'sqlauth',
                '_InstallUser' => 'sa',
                '_InstallWindowsAuthentication' => 'sqlauth',
                '_WebWindowsAuthentication' => 'sqlauth',
-       );
+       ];
 
        // SQL Server 2005 RTM
        // @todo Are SQL Express version numbers different?)
 
        // SQL Server 2005 RTM
        // @todo Are SQL Express version numbers different?)
@@ -52,13 +52,13 @@ class MssqlInstaller extends DatabaseInstaller {
        // These are schema-level privs
        // Note: the web user will be created will full permissions if possible, this permission
        // list is only used if we are unable to grant full permissions.
        // These are schema-level privs
        // Note: the web user will be created will full permissions if possible, this permission
        // list is only used if we are unable to grant full permissions.
-       public $webUserPrivs = array(
+       public $webUserPrivs = [
                'DELETE',
                'INSERT',
                'SELECT',
                'UPDATE',
                'EXECUTE',
                'DELETE',
                'INSERT',
                'SELECT',
                'UPDATE',
                'EXECUTE',
-       );
+       ];
 
        /**
         * @return string
 
        /**
         * @return string
@@ -87,48 +87,48 @@ class MssqlInstaller extends DatabaseInstaller {
                return $this->getTextBox(
                        'wgDBserver',
                        'config-db-host',
                return $this->getTextBox(
                        'wgDBserver',
                        'config-db-host',
-                       array(),
+                       [],
                        $this->parent->getHelpBox( 'config-db-host-help' )
                ) .
                        Html::openElement( 'fieldset' ) .
                        $this->parent->getHelpBox( 'config-db-host-help' )
                ) .
                        Html::openElement( 'fieldset' ) .
-                       Html::element( 'legend', array(), wfMessage( 'config-db-wiki-settings' )->text() ) .
-                       $this->getTextBox( 'wgDBname', 'config-db-name', array( 'dir' => 'ltr' ),
+                       Html::element( 'legend', [], wfMessage( 'config-db-wiki-settings' )->text() ) .
+                       $this->getTextBox( 'wgDBname', 'config-db-name', [ 'dir' => 'ltr' ],
                                $this->parent->getHelpBox( 'config-db-name-help' ) ) .
                                $this->parent->getHelpBox( 'config-db-name-help' ) ) .
-                       $this->getTextBox( 'wgDBmwschema', 'config-db-schema', array( 'dir' => 'ltr' ),
+                       $this->getTextBox( 'wgDBmwschema', 'config-db-schema', [ 'dir' => 'ltr' ],
                                $this->parent->getHelpBox( 'config-db-schema-help' ) ) .
                                $this->parent->getHelpBox( 'config-db-schema-help' ) ) .
-                       $this->getTextBox( 'wgDBprefix', 'config-db-prefix', array( 'dir' => 'ltr' ),
+                       $this->getTextBox( 'wgDBprefix', 'config-db-prefix', [ 'dir' => 'ltr' ],
                                $this->parent->getHelpBox( 'config-db-prefix-help' ) ) .
                        Html::closeElement( 'fieldset' ) .
                        Html::openElement( 'fieldset' ) .
                                $this->parent->getHelpBox( 'config-db-prefix-help' ) ) .
                        Html::closeElement( 'fieldset' ) .
                        Html::openElement( 'fieldset' ) .
-                       Html::element( 'legend', array(), wfMessage( 'config-db-install-account' )->text() ) .
-                       $this->getRadioSet( array(
+                       Html::element( 'legend', [], wfMessage( 'config-db-install-account' )->text() ) .
+                       $this->getRadioSet( [
                                'var' => '_InstallWindowsAuthentication',
                                'label' => 'config-mssql-auth',
                                'itemLabelPrefix' => 'config-mssql-',
                                'var' => '_InstallWindowsAuthentication',
                                'label' => 'config-mssql-auth',
                                'itemLabelPrefix' => 'config-mssql-',
-                               'values' => array( 'sqlauth', 'windowsauth' ),
-                               'itemAttribs' => array(
-                                       'sqlauth' => array(
+                               'values' => [ 'sqlauth', 'windowsauth' ],
+                               'itemAttribs' => [
+                                       'sqlauth' => [
                                                'class' => 'showHideRadio',
                                                'rel' => 'dbCredentialBox',
                                                'class' => 'showHideRadio',
                                                'rel' => 'dbCredentialBox',
-                                       ),
-                                       'windowsauth' => array(
+                                       ],
+                                       'windowsauth' => [
                                                'class' => 'hideShowRadio',
                                                'rel' => 'dbCredentialBox',
                                                'class' => 'hideShowRadio',
                                                'rel' => 'dbCredentialBox',
-                                       )
-                               ),
+                                       ]
+                               ],
                                'help' => $this->parent->getHelpBox( 'config-mssql-install-auth' )
                                'help' => $this->parent->getHelpBox( 'config-mssql-install-auth' )
-                       ) ) .
-                       Html::openElement( 'div', array( 'id' => 'dbCredentialBox', 'style' => $displayStyle ) ) .
+                       ] ) .
+                       Html::openElement( 'div', [ 'id' => 'dbCredentialBox', 'style' => $displayStyle ] ) .
                        $this->getTextBox(
                                '_InstallUser',
                                'config-db-username',
                        $this->getTextBox(
                                '_InstallUser',
                                'config-db-username',
-                               array( 'dir' => 'ltr' ),
+                               [ 'dir' => 'ltr' ],
                                $this->parent->getHelpBox( 'config-db-install-username' )
                        ) .
                        $this->getPasswordBox(
                                '_InstallPassword',
                                'config-db-password',
                                $this->parent->getHelpBox( 'config-db-install-username' )
                        ) .
                        $this->getPasswordBox(
                                '_InstallPassword',
                                'config-db-password',
-                               array( 'dir' => 'ltr' ),
+                               [ 'dir' => 'ltr' ],
                                $this->parent->getHelpBox( 'config-db-install-password' )
                        ) .
                        Html::closeElement( 'div' ) .
                                $this->parent->getHelpBox( 'config-db-install-password' )
                        ) .
                        Html::closeElement( 'div' ) .
@@ -137,12 +137,12 @@ class MssqlInstaller extends DatabaseInstaller {
 
        public function submitConnectForm() {
                // Get variables from the request.
 
        public function submitConnectForm() {
                // Get variables from the request.
-               $newValues = $this->setVarsFromRequest( array(
+               $newValues = $this->setVarsFromRequest( [
                        'wgDBserver',
                        'wgDBname',
                        'wgDBmwschema',
                        'wgDBprefix'
                        'wgDBserver',
                        'wgDBname',
                        'wgDBmwschema',
                        'wgDBprefix'
-               ) );
+               ] );
 
                // Validate them.
                $status = Status::newGood();
 
                // Validate them.
                $status = Status::newGood();
@@ -170,11 +170,11 @@ class MssqlInstaller extends DatabaseInstaller {
                }
 
                // User box
                }
 
                // User box
-               $this->setVarsFromRequest( array(
+               $this->setVarsFromRequest( [
                        '_InstallUser',
                        '_InstallPassword',
                        '_InstallWindowsAuthentication'
                        '_InstallUser',
                        '_InstallPassword',
                        '_InstallWindowsAuthentication'
-               ) );
+               ] );
 
                // Try to connect
                $status = $this->getConnection();
 
                // Try to connect
                $status = $this->getConnection();
@@ -212,14 +212,14 @@ class MssqlInstaller extends DatabaseInstaller {
                }
 
                try {
                }
 
                try {
-                       $db = DatabaseBase::factory( 'mssql', array(
+                       $db = DatabaseBase::factory( 'mssql', [
                                'host' => $this->getVar( 'wgDBserver' ),
                                'user' => $user,
                                'password' => $password,
                                'dbname' => false,
                                'flags' => 0,
                                'schema' => $this->getVar( 'wgDBmwschema' ),
                                'host' => $this->getVar( 'wgDBserver' ),
                                'user' => $user,
                                'password' => $password,
                                'dbname' => false,
                                'flags' => 0,
                                'schema' => $this->getVar( 'wgDBmwschema' ),
-                               'tablePrefix' => $this->getVar( 'wgDBprefix' ) ) );
+                               'tablePrefix' => $this->getVar( 'wgDBprefix' ) ] );
                        $db->prepareStatements( false );
                        $db->scrollableCursor( false );
                        $status->value = $db;
                        $db->prepareStatements( false );
                        $db->scrollableCursor( false );
                        $status->value = $db;
@@ -266,10 +266,10 @@ class MssqlInstaller extends DatabaseInstaller {
 
                // We need the server-level ALTER ANY LOGIN permission to create new accounts
                $res = $conn->query( "SELECT permission_name FROM sys.fn_my_permissions( NULL, 'SERVER' )" );
 
                // We need the server-level ALTER ANY LOGIN permission to create new accounts
                $res = $conn->query( "SELECT permission_name FROM sys.fn_my_permissions( NULL, 'SERVER' )" );
-               $serverPrivs = array(
+               $serverPrivs = [
                        'ALTER ANY LOGIN' => false,
                        'CONTROL SERVER' => false,
                        'ALTER ANY LOGIN' => false,
                        'CONTROL SERVER' => false,
-               );
+               ];
 
                foreach ( $res as $row ) {
                        $serverPrivs[$row->permission_name] = true;
 
                foreach ( $res as $row ) {
                        $serverPrivs[$row->permission_name] = true;
@@ -284,25 +284,25 @@ class MssqlInstaller extends DatabaseInstaller {
                // and just check for the permission
                // http://technet.microsoft.com/en-us/library/ms178569.aspx
                // The following array sets up which permissions imply whatever permissions we specify
                // and just check for the permission
                // http://technet.microsoft.com/en-us/library/ms178569.aspx
                // The following array sets up which permissions imply whatever permissions we specify
-               $implied = array(
+               $implied = [
                        // schema           database  server
                        // schema           database  server
-                       'DELETE'  => array( 'DELETE', 'CONTROL SERVER' ),
-                       'EXECUTE' => array( 'EXECUTE', 'CONTROL SERVER' ),
-                       'INSERT'  => array( 'INSERT', 'CONTROL SERVER' ),
-                       'SELECT'  => array( 'SELECT', 'CONTROL SERVER' ),
-                       'UPDATE'  => array( 'UPDATE', 'CONTROL SERVER' ),
-               );
+                       'DELETE'  => [ 'DELETE', 'CONTROL SERVER' ],
+                       'EXECUTE' => [ 'EXECUTE', 'CONTROL SERVER' ],
+                       'INSERT'  => [ 'INSERT', 'CONTROL SERVER' ],
+                       'SELECT'  => [ 'SELECT', 'CONTROL SERVER' ],
+                       'UPDATE'  => [ 'UPDATE', 'CONTROL SERVER' ],
+               ];
 
                $grantOptions = array_flip( $this->webUserPrivs );
 
                // Check for schema and db-level permissions, but only if the schema/db exists
 
                $grantOptions = array_flip( $this->webUserPrivs );
 
                // Check for schema and db-level permissions, but only if the schema/db exists
-               $schemaPrivs = $dbPrivs = array(
+               $schemaPrivs = $dbPrivs = [
                        'DELETE' => false,
                        'EXECUTE' => false,
                        'INSERT' => false,
                        'SELECT' => false,
                        'UPDATE' => false,
                        'DELETE' => false,
                        'EXECUTE' => false,
                        'INSERT' => false,
                        'SELECT' => false,
                        'UPDATE' => false,
-               );
+               ];
 
                $dbPrivs['ALTER ANY USER'] = false;
 
 
                $dbPrivs['ALTER ANY USER'] = false;
 
@@ -365,30 +365,30 @@ class MssqlInstaller extends DatabaseInstaller {
                        ? 'display: none'
                        : '';
                $s = Html::openElement( 'fieldset' ) .
                        ? 'display: none'
                        : '';
                $s = Html::openElement( 'fieldset' ) .
-                       Html::element( 'legend', array(), wfMessage( 'config-db-web-account' )->text() ) .
+                       Html::element( 'legend', [], wfMessage( 'config-db-web-account' )->text() ) .
                        $this->getCheckBox(
                                '_SameAccount', 'config-db-web-account-same',
                        $this->getCheckBox(
                                '_SameAccount', 'config-db-web-account-same',
-                               array( 'class' => 'hideShowRadio', 'rel' => 'dbOtherAccount' )
+                               [ 'class' => 'hideShowRadio', 'rel' => 'dbOtherAccount' ]
                        ) .
                        ) .
-                       Html::openElement( 'div', array( 'id' => 'dbOtherAccount', 'style' => $wrapperStyle ) ) .
-                       $this->getRadioSet( array(
+                       Html::openElement( 'div', [ 'id' => 'dbOtherAccount', 'style' => $wrapperStyle ] ) .
+                       $this->getRadioSet( [
                                'var' => '_WebWindowsAuthentication',
                                'label' => 'config-mssql-auth',
                                'itemLabelPrefix' => 'config-mssql-',
                                'var' => '_WebWindowsAuthentication',
                                'label' => 'config-mssql-auth',
                                'itemLabelPrefix' => 'config-mssql-',
-                               'values' => array( 'sqlauth', 'windowsauth' ),
-                               'itemAttribs' => array(
-                                       'sqlauth' => array(
+                               'values' => [ 'sqlauth', 'windowsauth' ],
+                               'itemAttribs' => [
+                                       'sqlauth' => [
                                                'class' => 'showHideRadio',
                                                'rel' => 'dbCredentialBox',
                                                'class' => 'showHideRadio',
                                                'rel' => 'dbCredentialBox',
-                                       ),
-                                       'windowsauth' => array(
+                                       ],
+                                       'windowsauth' => [
                                                'class' => 'hideShowRadio',
                                                'rel' => 'dbCredentialBox',
                                                'class' => 'hideShowRadio',
                                                'rel' => 'dbCredentialBox',
-                                       )
-                               ),
+                                       ]
+                               ],
                                'help' => $this->parent->getHelpBox( 'config-mssql-web-auth' )
                                'help' => $this->parent->getHelpBox( 'config-mssql-web-auth' )
-                       ) ) .
-                       Html::openElement( 'div', array( 'id' => 'dbCredentialBox', 'style' => $displayStyle ) ) .
+                       ] ) .
+                       Html::openElement( 'div', [ 'id' => 'dbCredentialBox', 'style' => $displayStyle ] ) .
                        $this->getTextBox( 'wgDBuser', 'config-db-username' ) .
                        $this->getPasswordBox( 'wgDBpassword', 'config-db-password' ) .
                        Html::closeElement( 'div' );
                        $this->getTextBox( 'wgDBuser', 'config-db-username' ) .
                        $this->getPasswordBox( 'wgDBpassword', 'config-db-password' ) .
                        Html::closeElement( 'div' );
@@ -408,13 +408,13 @@ class MssqlInstaller extends DatabaseInstaller {
         * @return Status
         */
        public function submitSettingsForm() {
         * @return Status
         */
        public function submitSettingsForm() {
-               $this->setVarsFromRequest( array(
+               $this->setVarsFromRequest( [
                                'wgDBuser',
                                'wgDBpassword',
                                '_SameAccount',
                                '_CreateDBAccount',
                                '_WebWindowsAuthentication'
                                'wgDBuser',
                                'wgDBpassword',
                                '_SameAccount',
                                '_CreateDBAccount',
                                '_WebWindowsAuthentication'
-               ) );
+               ] );
 
                if ( $this->getVar( '_SameAccount' ) ) {
                        $this->setVar( '_WebWindowsAuthentication', $this->getVar( '_InstallWindowsAuthentication' ) );
 
                if ( $this->getVar( '_SameAccount' ) ) {
                        $this->setVar( '_WebWindowsAuthentication', $this->getVar( '_InstallWindowsAuthentication' ) );
@@ -457,7 +457,7 @@ class MssqlInstaller extends DatabaseInstaller {
                        }
 
                        try {
                        }
 
                        try {
-                               DatabaseBase::factory( 'mssql', array(
+                               DatabaseBase::factory( 'mssql', [
                                        'host' => $this->getVar( 'wgDBserver' ),
                                        'user' => $user,
                                        'password' => $password,
                                        'host' => $this->getVar( 'wgDBserver' ),
                                        'user' => $user,
                                        'password' => $password,
@@ -465,7 +465,7 @@ class MssqlInstaller extends DatabaseInstaller {
                                        'flags' => 0,
                                        'tablePrefix' => $this->getVar( 'wgDBprefix' ),
                                        'schema' => $this->getVar( 'wgDBmwschema' ),
                                        'flags' => 0,
                                        'tablePrefix' => $this->getVar( 'wgDBprefix' ),
                                        'schema' => $this->getVar( 'wgDBmwschema' ),
-                               ) );
+                               ] );
                        } catch ( DBConnectionError $e ) {
                                return Status::newFatal( 'config-connection-error', $e->getMessage() );
                        }
                        } catch ( DBConnectionError $e ) {
                                return Status::newFatal( 'config-connection-error', $e->getMessage() );
                        }
@@ -476,10 +476,10 @@ class MssqlInstaller extends DatabaseInstaller {
 
        public function preInstall() {
                # Add our user callback to installSteps, right before the tables are created.
 
        public function preInstall() {
                # Add our user callback to installSteps, right before the tables are created.
-               $callback = array(
+               $callback = [
                        'name' => 'user',
                        'name' => 'user',
-                       'callback' => array( $this, 'setupUser' ),
-               );
+                       'callback' => [ $this, 'setupUser' ],
+               ];
                $this->parent->addInstallStep( $callback, 'tables' );
        }
 
                $this->parent->addInstallStep( $callback, 'tables' );
        }
 
@@ -537,7 +537,6 @@ class MssqlInstaller extends DatabaseInstaller {
                $this->setupSchemaVars();
                $dbName = $this->getVar( 'wgDBname' );
                $this->db->selectDB( $dbName );
                $this->setupSchemaVars();
                $dbName = $this->getVar( 'wgDBname' );
                $this->db->selectDB( $dbName );
-               $server = $this->getVar( 'wgDBserver' );
                $password = $this->getVar( 'wgDBpassword' );
                $schemaName = $this->getVar( 'wgDBmwschema' );
 
                $password = $this->getVar( 'wgDBpassword' );
                $schemaName = $this->getVar( 'wgDBmwschema' );
 
@@ -555,7 +554,7 @@ class MssqlInstaller extends DatabaseInstaller {
                $escUser = $this->db->addIdentifierQuotes( $dbUser );
                $escDb = $this->db->addIdentifierQuotes( $dbName );
                $escSchema = $this->db->addIdentifierQuotes( $schemaName );
                $escUser = $this->db->addIdentifierQuotes( $dbUser );
                $escDb = $this->db->addIdentifierQuotes( $dbName );
                $escSchema = $this->db->addIdentifierQuotes( $schemaName );
-               $grantableNames = array();
+               $grantableNames = [];
                if ( $tryToCreate ) {
                        $escPass = $this->db->addQuotes( $password );
 
                if ( $tryToCreate ) {
                        $escPass = $this->db->addQuotes( $password );
 
@@ -597,10 +596,10 @@ class MssqlInstaller extends DatabaseInstaller {
                foreach ( $grantableNames as $name ) {
                        try {
                                // First try to grant full permissions
                foreach ( $grantableNames as $name ) {
                        try {
                                // First try to grant full permissions
-                               $fullPrivArr = array(
+                               $fullPrivArr = [
                                        'BACKUP DATABASE', 'BACKUP LOG', 'CREATE FUNCTION', 'CREATE PROCEDURE',
                                        'CREATE TABLE', 'CREATE VIEW', 'CREATE FULLTEXT CATALOG', 'SHOWPLAN'
                                        'BACKUP DATABASE', 'BACKUP LOG', 'CREATE FUNCTION', 'CREATE PROCEDURE',
                                        'CREATE TABLE', 'CREATE VIEW', 'CREATE FULLTEXT CATALOG', 'SHOWPLAN'
-                               );
+                               ];
                                $fullPrivList = implode( ', ', $fullPrivArr );
                                $this->db->begin();
                                $this->db->query( "GRANT $fullPrivList ON DATABASE :: $escDb TO $escUser", __METHOD__ );
                                $fullPrivList = implode( ', ', $fullPrivArr );
                                $this->db->begin();
                                $this->db->query( "GRANT $fullPrivList ON DATABASE :: $escDb TO $escUser", __METHOD__ );
@@ -635,7 +634,7 @@ class MssqlInstaller extends DatabaseInstaller {
                $status = parent::createTables();
 
                // Do last-minute stuff like fulltext indexes (since they can't be inside a transaction)
                $status = parent::createTables();
 
                // Do last-minute stuff like fulltext indexes (since they can't be inside a transaction)
-               if ( $status->isOk() ) {
+               if ( $status->isOK() ) {
                        $searchindex = $this->db->tableName( 'searchindex' );
                        $schema = $this->db->addIdentifierQuotes( $this->getVar( 'wgDBmwschema' ) );
                        try {
                        $searchindex = $this->db->tableName( 'searchindex' );
                        $schema = $this->db->addIdentifierQuotes( $this->getVar( 'wgDBmwschema' ) );
                        try {
@@ -652,9 +651,9 @@ class MssqlInstaller extends DatabaseInstaller {
        public function getGlobalDefaults() {
                // The default $wgDBmwschema is null, which breaks Postgres and other DBMSes that require
                // the use of a schema, so we need to set it here
        public function getGlobalDefaults() {
                // The default $wgDBmwschema is null, which breaks Postgres and other DBMSes that require
                // the use of a schema, so we need to set it here
-               return array(
+               return array_merge( parent::getGlobalDefaults(), [
                        'wgDBmwschema' => 'mediawiki',
                        'wgDBmwschema' => 'mediawiki',
-               );
+               );
        }
 
        /**
        }
 
        /**
@@ -663,7 +662,7 @@ class MssqlInstaller extends DatabaseInstaller {
         * @return bool
         */
        private function loginExists( $user ) {
         * @return bool
         */
        private function loginExists( $user ) {
-               $res = $this->db->selectField( 'sys.sql_logins', 1, array( 'name' => $user ) );
+               $res = $this->db->selectField( 'sys.sql_logins', 1, [ 'name' => $user ] );
                return (bool)$res;
        }
 
                return (bool)$res;
        }
 
@@ -674,7 +673,7 @@ class MssqlInstaller extends DatabaseInstaller {
         * @return bool
         */
        private function userExists( $user ) {
         * @return bool
         */
        private function userExists( $user ) {
-               $res = $this->db->selectField( 'sys.sysusers', 1, array( 'name' => $user ) );
+               $res = $this->db->selectField( 'sys.sysusers', 1, [ 'name' => $user ] );
                return (bool)$res;
        }
 
                return (bool)$res;
        }
 
@@ -684,7 +683,7 @@ class MssqlInstaller extends DatabaseInstaller {
         * @return bool
         */
        private function databaseExists( $dbName ) {
         * @return bool
         */
        private function databaseExists( $dbName ) {
-               $res = $this->db->selectField( 'sys.databases', 1, array( 'name' => $dbName ) );
+               $res = $this->db->selectField( 'sys.databases', 1, [ 'name' => $dbName ] );
                return (bool)$res;
        }
 
                return (bool)$res;
        }
 
@@ -695,18 +694,18 @@ class MssqlInstaller extends DatabaseInstaller {
         * @return bool
         */
        private function schemaExists( $schemaName ) {
         * @return bool
         */
        private function schemaExists( $schemaName ) {
-               $res = $this->db->selectField( 'sys.schemas', 1, array( 'name' => $schemaName ) );
+               $res = $this->db->selectField( 'sys.schemas', 1, [ 'name' => $schemaName ] );
                return (bool)$res;
        }
 
        /**
         * Try to see if a given fulltext catalog exists
         * We assume we already have the appropriate database selected
                return (bool)$res;
        }
 
        /**
         * Try to see if a given fulltext catalog exists
         * We assume we already have the appropriate database selected
-        * @param string $schemaName Catalog name to check
+        * @param string $catalogName Catalog name to check
         * @return bool
         */
        private function catalogExists( $catalogName ) {
         * @return bool
         */
        private function catalogExists( $catalogName ) {
-               $res = $this->db->selectField( 'sys.fulltext_catalogs', 1, array( 'name' => $catalogName ) );
+               $res = $this->db->selectField( 'sys.fulltext_catalogs', 1, [ 'name' => $catalogName ] );
                return (bool)$res;
        }
 
                return (bool)$res;
        }
 
@@ -716,12 +715,12 @@ class MssqlInstaller extends DatabaseInstaller {
         * @return array
         */
        public function getSchemaVars() {
         * @return array
         */
        public function getSchemaVars() {
-               return array(
+               return [
                        'wgDBname' => $this->getVar( 'wgDBname' ),
                        'wgDBmwschema' => $this->getVar( 'wgDBmwschema' ),
                        'wgDBuser' => $this->getVar( 'wgDBuser' ),
                        'wgDBpassword' => $this->getVar( 'wgDBpassword' ),
                        'wgDBname' => $this->getVar( 'wgDBname' ),
                        'wgDBmwschema' => $this->getVar( 'wgDBmwschema' ),
                        'wgDBuser' => $this->getVar( 'wgDBuser' ),
                        'wgDBpassword' => $this->getVar( 'wgDBpassword' ),
-               );
+               ];
        }
 
        public function getLocalSettings() {
        }
 
        public function getLocalSettings() {