Improve documentation
authorSam Reed <reedy@users.mediawiki.org>
Thu, 2 Feb 2012 20:19:20 +0000 (20:19 +0000)
committerSam Reed <reedy@users.mediawiki.org>
Thu, 2 Feb 2012 20:19:20 +0000 (20:19 +0000)
Simplify if

Fix whitespace

includes/interwiki/Interwiki.php
maintenance/getSlaveServer.php
tests/parser/parserTest.inc

index e6469a1..3aaa1c5 100644 (file)
@@ -136,7 +136,7 @@ class Interwiki {
        /**
         * Load the interwiki, trying first memcached then the DB
         *
-        * @param $prefix The interwiki prefix
+        * @param $prefix string The interwiki prefix
         * @return Boolean: the prefix is valid
         */
        protected static function load( $prefix ) {
@@ -186,8 +186,8 @@ class Interwiki {
        /**
         * Fill in member variables from an array (e.g. memcached result, Database::fetchRow, etc)
         *
-        * @param $mc Associative array: row from the interwiki table
-        * @return Boolean: whether everything was there
+        * @param $mc array Associative array: row from the interwiki table
+        * @return Boolean|Interwiki whether everything was there
         */
        protected static function loadFromArray( $mc ) {
                if( isset( $mc['iw_url'] ) ) {
@@ -206,7 +206,7 @@ class Interwiki {
        /**
         * Fetch all interwiki prefixes from interwiki cache
         *
-        * @param $local If not null, limits output to local/non-local interwikis
+        * @param $local null|string If not null, limits output to local/non-local interwikis
         * @return Array List of prefixes
         * @since 1.19
         */
@@ -270,7 +270,7 @@ class Interwiki {
        /**
         * Fetch all interwiki prefixes from DB
         *
-        * @param $local If not null, limits output to local/non-local interwikis
+        * @param $local string|null If not null, limits output to local/non-local interwikis
         * @return Array List of prefixes
         * @since 1.19
         */
@@ -301,7 +301,7 @@ class Interwiki {
        /**
         * Returns all interwiki prefixes
         *
-        * @param $local If set, limits output to local/non-local interwikis
+        * @param $local string|null If set, limits output to local/non-local interwikis
         * @return Array List of prefixes
         * @since 1.19
         */
index a9d93f1..3d13bc4 100644 (file)
@@ -32,15 +32,13 @@ class GetSlaveServer extends Maintenance {
                global $wgAllDBsAreLocalhost;
                if ( $wgAllDBsAreLocalhost ) {
                        $host = 'localhost';
+               } elseif ( $this->hasOption( 'group' ) ) {
+                       $db = wfGetDB( DB_SLAVE, $this->getOption( 'group' ) );
+                       $host = $db->getServer();
                } else {
-                       if ( $this->hasOption( 'group' ) ) {
-                               $db = wfGetDB( DB_SLAVE, $this->getOption( 'group' ) );
-                               $host = $db->getServer();
-                       } else {
-                               $lb = wfGetLB();
-                               $i = $lb->getReaderIndex();
-                               $host = $lb->getServerName( $i );
-                       }
+                       $lb = wfGetLB();
+                       $i = $lb->getReaderIndex();
+                       $host = $lb->getServerName( $i );
                }
                $this->output( "$host\n" );
        }
index ac557a3..30e451b 100644 (file)
@@ -837,7 +837,6 @@ class ParserTest {
                                   'iw_local'  => 1 ),
                        ) );
 
-
                # Update certain things in site_stats
                $this->db->insert( 'site_stats', array( 'ss_row_id' => 1, 'ss_images' => 2, 'ss_good_articles' => 1 ) );