More documentation of parameters following up r104591
authorSam Reed <reedy@users.mediawiki.org>
Mon, 5 Dec 2011 16:50:58 +0000 (16:50 +0000)
committerSam Reed <reedy@users.mediawiki.org>
Mon, 5 Dec 2011 16:50:58 +0000 (16:50 +0000)
includes/Skin.php
includes/db/Database.php
includes/db/DatabaseError.php
includes/db/DatabaseMysql.php
includes/db/LBFactory.php
includes/db/LBFactory_Multi.php
includes/db/LoadBalancer.php

index f3a37f9..03a8338 100644 (file)
@@ -288,7 +288,7 @@ abstract class Skin extends ContextSource {
        abstract function outputPage( OutputPage $out = null );
 
        /**
-        * @param $data
+        * @param $data array
         * @return string
         */
        static function makeVariablesScript( $data ) {
@@ -543,7 +543,7 @@ abstract class Skin extends ContextSource {
        }
 
        /**
-        * @param $debugText
+        * @param $debugText string
         * @return string
         */
        private function formatDebugHTML( $debugText ) {
@@ -734,7 +734,7 @@ abstract class Skin extends ContextSource {
        }
 
        /**
-        * @param string $type
+        * @param $type string
         * @return string
         */
        function getCopyright( $type = 'detect' ) {
@@ -976,7 +976,7 @@ abstract class Skin extends ContextSource {
        }
 
        /**
-        * @param $id
+        * @param $id User|int
         * @return bool
         */
        function showEmailUser( $id ) {
@@ -1027,7 +1027,7 @@ abstract class Skin extends ContextSource {
        }
 
        /**
-        * @param $name
+        * @param $name string
         * @param $urlaction string
         * @return String
         */
@@ -1037,8 +1037,8 @@ abstract class Skin extends ContextSource {
        }
 
        /**
-        * @param $name
-        * @param $subpage
+        * @param $name string
+        * @param $subpage string
         * @param $urlaction string
         * @return String
         */
@@ -1048,7 +1048,7 @@ abstract class Skin extends ContextSource {
        }
 
        /**
-        * @param $name
+        * @param $name string
         * @param $urlaction string
         * @return String
         */
@@ -1059,7 +1059,7 @@ abstract class Skin extends ContextSource {
        }
 
        /**
-        * @param $name
+        * @param $name string
         * @param $urlaction string
         * @return String
         */
@@ -1134,7 +1134,7 @@ abstract class Skin extends ContextSource {
         * make sure we have some title to operate on
         *
         * @param $title Title
-        * @param $name
+        * @param $name string
         */
        static function checkTitle( &$title, $name ) {
                if ( !is_object( $title ) ) {
index 3037769..0f39465 100644 (file)
@@ -2280,7 +2280,7 @@ abstract class DatabaseBase implements DatabaseType {
         * Any implementation of this function should *not* involve reusing
         * sequence numbers created for rolled-back transactions.
         * See http://bugs.mysql.com/bug.php?id=30767 for details.
-        * @param $seqName
+        * @param $seqName string
         * @return null
         */
        function nextSequenceValue( $seqName ) {
@@ -2374,9 +2374,9 @@ abstract class DatabaseBase implements DatabaseType {
         * REPLACE query wrapper for MySQL and SQLite, which have a native REPLACE
         * statement.
         *
-        * @param $table Table name
-        * @param $rows Rows to insert
-        * @param $fname Caller function name
+        * @param $table string Table name
+        * @param $rows array Rows to insert
+        * @param $fname string Caller function name
         *
         * @return ResultWrapper
         */
@@ -3017,8 +3017,8 @@ abstract class DatabaseBase implements DatabaseType {
         * don't allow simple quoted strings to be inserted. To insert into such
         * a field, pass the data through this function before passing it to
         * DatabaseBase::insert().
-        * @param $b
-        * @return
+        * @param $b string
+        * @return string
         */
        function encodeBlob( $b ) {
                return $b;
@@ -3028,8 +3028,8 @@ abstract class DatabaseBase implements DatabaseType {
         * Some DBMSs return a special placeholder object representing blob fields
         * in result objects. Pass the object through this function to return the
         * original string.
-        * @param $b
-        * @return
+        * @param $b string
+        * @return string
         */
        function decodeBlob( $b ) {
                return $b;
index fef4784..0ca7923 100644 (file)
@@ -262,10 +262,10 @@ class DBQueryError extends DBError {
 
        /**
         * @param $db DatabaseBase
-        * @param $error
-        * @param $errno
-        * @param $sql
-        * @param $fname
+        * @param $error string
+        * @param $errno int|string
+        * @param $sql string
+        * @param $fname string
         */
        function __construct( DatabaseBase &$db, $error, $errno, $sql, $fname ) {
                $message = "A database error has occurred.  Did you forget to run maintenance/update.php after upgrading?  See: https://www.mediawiki.org/wiki/Manual:Upgrading#Run_the_update_script\n" .
index 4bde72b..cdec384 100644 (file)
@@ -23,7 +23,7 @@ class DatabaseMysql extends DatabaseBase {
        }
 
        /**
-        * @param $sql
+        * @param $sql string
         * @return resource
         */
        protected function doQuery( $sql ) {
@@ -36,10 +36,10 @@ class DatabaseMysql extends DatabaseBase {
        }
 
        /**
-        * @param $server
-        * @param $user
-        * @param $password
-        * @param $dbName
+        * @param $server string
+        * @param $user string
+        * @param $password string
+        * @param $dbName string
         * @return bool
         * @throws DBConnectionError
         */
@@ -167,7 +167,7 @@ class DatabaseMysql extends DatabaseBase {
        }
 
        /**
-        * @param $res
+        * @param $res ResultWrapper
         * @throws DBUnexpectedError
         */
        function freeResult( $res ) {
@@ -183,7 +183,7 @@ class DatabaseMysql extends DatabaseBase {
        }
 
        /**
-        * @param $res
+        * @param $res ResultWrapper
         * @return object|stdClass
         * @throws DBUnexpectedError
         */
@@ -201,7 +201,7 @@ class DatabaseMysql extends DatabaseBase {
        }
 
        /**
-        * @param $res
+        * @param $res ResultWrapper
         * @return array
         * @throws DBUnexpectedError
         */
@@ -220,7 +220,7 @@ class DatabaseMysql extends DatabaseBase {
 
        /**
         * @throws DBUnexpectedError
-        * @param $res
+        * @param $res ResultWrapper
         * @return int
         */
        function numRows( $res ) {
@@ -237,7 +237,7 @@ class DatabaseMysql extends DatabaseBase {
        }
 
        /**
-        * @param $res
+        * @param $res ResultWrapper
         * @return int
         */
        function numFields( $res ) {
@@ -248,8 +248,8 @@ class DatabaseMysql extends DatabaseBase {
        }
 
        /**
-        * @param $res
-        * @param $n
+        * @param $res ResultWrapper
+        * @param $n string
         * @return string
         */
        function fieldName( $res, $n ) {
@@ -267,7 +267,7 @@ class DatabaseMysql extends DatabaseBase {
        }
 
        /**
-        * @param $res
+        * @param $res ResultWrapper
         * @param $row
         * @return bool
         */
@@ -318,9 +318,9 @@ class DatabaseMysql extends DatabaseBase {
        }
 
        /**
-        * @param $table
+        * @param $table string
         * @param $uniqueIndexes
-        * @param $rows
+        * @param $rows array
         * @param $fname string
         * @return ResultWrapper
         */
@@ -382,8 +382,8 @@ class DatabaseMysql extends DatabaseBase {
         * Get information about an index into an object
         * Returns false if the index does not exist
         *
-        * @param $table
-        * @param $index
+        * @param $table string
+        * @param $index string
         * @param $fname string
         * @return false|array
         */
@@ -670,8 +670,8 @@ class DatabaseMysql extends DatabaseBase {
        }
 
        /**
-        * @param $lockName
-        * @param $method
+        * @param $lockName string
+        * @param $method string
         * @param $timeout int
         * @return bool
         */
@@ -690,9 +690,9 @@ class DatabaseMysql extends DatabaseBase {
 
        /**
         * FROM MYSQL DOCS: http://dev.mysql.com/doc/refman/5.0/en/miscellaneous-functions.html#function_release-lock
-        * @param $lockName
+        * @param $lockName string
         * @param $method string
-        * @return
+        * @return bool
         */
        public function unlock( $lockName, $method ) {
                $lockName = $this->addQuotes( $lockName );
@@ -702,9 +702,9 @@ class DatabaseMysql extends DatabaseBase {
        }
 
        /**
-        * @param $read
-        * @param $write
-        * @param $method
+        * @param $read array
+        * @param $write array
+        * @param $method string
         * @param $lowPriority bool
         */
        public function lockTables( $read, $write, $method, $lowPriority = true ) {
@@ -761,13 +761,13 @@ class DatabaseMysql extends DatabaseBase {
 
        /**
         * DELETE where the condition is a join. MySql uses multi-table deletes.
-        * @param $delTable
-        * @param $joinTable
-        * @param $delVar
-        * @param $joinVar
+        * @param $delTable string
+        * @param $joinTable string
+        * @param $delVar string
+        * @param $joinVar string
         * @param $conds array|string
         * @param $fname bool
-        * @return bool|\ResultWrapper
+        * @return bool|ResultWrapper
         */
        function deleteJoin( $delTable, $joinTable, $delVar, $joinVar, $conds, $fname = 'DatabaseBase::deleteJoin' ) {
                if ( !$conds ) {
index 0ed9224..dec6ae1 100644 (file)
@@ -42,7 +42,6 @@ abstract class LBFactory {
 
        /**
         * Shut down, close connections and destroy the cached instance.
-        *
         */
        static function destroyInstance() {
                if ( self::$instance ) {
@@ -111,7 +110,7 @@ abstract class LBFactory {
         * Execute a function for each tracked load balancer
         * The callback is called with the load balancer as the first parameter,
         * and $params passed as the subsequent parameters.
-        * @param $callback
+        * @param $callback string|array
         * @param array $params
         */
        abstract function forEachLB( $callback, $params = array() );
@@ -124,7 +123,7 @@ abstract class LBFactory {
 
        /**
         * Call a method of each tracked load balancer
-        * @param $methodName
+        * @param $methodName string
         * @param $args array
         */
        function forEachLBCallMethod( $methodName, $args = array() ) {
@@ -134,7 +133,7 @@ abstract class LBFactory {
        /**
         * Private helper for forEachLBCallMethod
         * @param $loadBalancer
-        * @param $methodName
+        * @param $methodName string
         * @param $args
         */
        function callMethod( $loadBalancer, $methodName, $args ) {
index 5f7cf0d..b7977a2 100644 (file)
@@ -54,7 +54,7 @@ class LBFactory_Multi extends LBFactory {
        var $lastWiki, $lastSection;
 
        /**
-        * @param $conf
+        * @param $conf array
         */
        function __construct( $conf ) {
                $this->chronProt = new ChronologyProtector;
@@ -173,7 +173,7 @@ class LBFactory_Multi extends LBFactory {
         * Make a new load balancer object based on template and load array
         *
         * @param $template
-        * @param $loads
+        * @param $loads array
         * @param $groupLoads
         * @return LoadBalancer
         */
@@ -191,7 +191,7 @@ class LBFactory_Multi extends LBFactory {
         * Make a server array as expected by LoadBalancer::__construct, using a template and load array
         *
         * @param $template
-        * @param $loads
+        * @param $loads array
         * @param $groupLoads
         * @return array
         */
@@ -248,7 +248,7 @@ class LBFactory_Multi extends LBFactory {
 
        /**
         * Get the database name and prefix based on the wiki ID
-        * @param bool $wiki
+        * @param $wiki bool
         * @return array
         */
        function getDBNameAndPrefix( $wiki = false ) {
index e21f1ee..8b86784 100644 (file)
@@ -101,7 +101,7 @@ class LoadBalancer {
         * Given an array of non-normalised probabilities, this function will select
         * an element and return the appropriate key
         *
-        * @param $weights
+        * @param $weights array
         *
         * @return int
         */
@@ -132,7 +132,7 @@ class LoadBalancer {
        }
 
        /**
-        * @param $loads
+        * @param $loads array
         * @param $wiki bool
         * @return bool|int|string
         */
@@ -336,8 +336,8 @@ class LoadBalancer {
 
        /**
         * Wait for a specified number of microseconds, and return the period waited
-        * @param $t
-        * @return
+        * @param $t int
+        * @return int
         */
        function sleep( $t ) {
                wfProfileIn( __METHOD__ );
@@ -351,7 +351,7 @@ class LoadBalancer {
         * Set the master wait position
         * If a DB_SLAVE connection has been opened already, waits
         * Otherwise sets a variable telling it to wait if such a connection is opened
-        * @param $pos
+        * @param $pos int
         */
        public function waitFor( $pos ) {
                wfProfileIn( __METHOD__ );
@@ -369,7 +369,7 @@ class LoadBalancer {
 
        /**
         * Set the master wait position and wait for ALL slaves to catch up to it
-        * @param $pos
+        * @param $pos int
         */
        public function waitForAll( $pos ) {
                wfProfileIn( __METHOD__ );
@@ -384,7 +384,7 @@ class LoadBalancer {
         * Get any open connection to a given server index, local or foreign
         * Returns false if there is no connection open
         *
-        * @param $i
+        * @param $i int
         * @return DatabaseBase|false
         */
        function getAnyOpenConnection( $i ) {