And some more....
authorSam Reed <reedy@users.mediawiki.org>
Sat, 28 May 2011 17:51:33 +0000 (17:51 +0000)
committerSam Reed <reedy@users.mediawiki.org>
Sat, 28 May 2011 17:51:33 +0000 (17:51 +0000)
includes/Cdb_PHP.php
includes/HTMLForm.php
includes/HistoryBlob.php
includes/db/LBFactory_Single.php
includes/filerepo/ForeignDBFile.php
includes/media/Tiff.php
includes/parser/ParserOutput.php
includes/parser/Preprocessor.php

index 70dccdf..f4029ba 100644 (file)
@@ -16,6 +16,10 @@ class CdbFunctions {
        /**
         * Take a modulo of a signed integer as if it were an unsigned integer.
         * $b must be less than 0x40000000 and greater than 0
+        *
+        * @param $a
+        * @param $b
+        *
         * @return int
         */
        public static function unsignedMod( $a, $b ) {
@@ -48,6 +52,7 @@ class CdbFunctions {
         * The CDB hash function.
         * 
         * @param $s
+        *
         * @return
         */
        public static function hash( $s ) {
@@ -116,6 +121,10 @@ class CdbReader_PHP extends CdbReader {
                unset( $this->handle );
        }
 
+       /**
+        * @param $key
+        * @return bool|string
+        */
        public function get( $key ) {
                // strval is required
                if ( $this->find( strval( $key ) ) ) {
@@ -327,6 +336,11 @@ class CdbWriter_PHP extends CdbWriter {
                $this->pos = $newpos;
        }
 
+       /**
+        * @param $keylen
+        * @param $datalen
+        * @param $h
+        */
        protected function addend( $keylen, $datalen, $h ) {
                $this->hplist[] = array(
                        'h' => $h,
@@ -355,6 +369,9 @@ class CdbWriter_PHP extends CdbWriter {
                $this->write( $buf );
        }
 
+       /**
+        * @throws MWException
+        */
        protected function finish() {
                // Hack for DBA cross-check
                $this->hplist = array_reverse( $this->hplist );
index ec038c9..9880054 100644 (file)
@@ -861,7 +861,7 @@ abstract class HTMLFormField {
 
        /**
         * Initialise the object
-        * @param $params Associative Array. See HTMLForm doc for syntax.
+        * @param $params array Associative Array. See HTMLForm doc for syntax.
         */
        function __construct( $params ) {
                $this->mParams = $params;
index 3fc27a2..fdc55a5 100644 (file)
@@ -290,6 +290,8 @@ class HistoryBlobCurStub {
        /**
         * Sets the location (cur_id) of the main object to which this object
         * points
+        *
+        * @param $id int
         */
        function setLocation( $id ) {
                $this->mCurId = $id;
@@ -482,6 +484,11 @@ class DiffHistoryBlob implements HistoryBlob {
                }
        }
 
+       /**
+        * @param $t1
+        * @param $t2
+        * @return string
+        */
        function diff( $t1, $t2 ) {
                # Need to do a null concatenation with warnings off, due to bugs in the current version of xdiff
                # "String is not zero-terminated"
@@ -491,6 +498,11 @@ class DiffHistoryBlob implements HistoryBlob {
                return $diff;
        }
 
+       /**
+        * @param $base
+        * @param $diff
+        * @return bool|string
+        */
        function patch( $base, $diff ) {
                if ( function_exists( 'xdiff_string_bpatch' ) ) {
                        wfSuppressWarnings();
@@ -561,6 +573,9 @@ class DiffHistoryBlob implements HistoryBlob {
                }
        }
 
+       /**
+        * @return array
+        */
        function __sleep() {
                $this->compress();
                if ( !count( $this->mItems ) ) {
@@ -626,6 +641,8 @@ class DiffHistoryBlob implements HistoryBlob {
        /**
         * Helper function for compression jobs
         * Returns true until the object is "full" and ready to be committed
+        *
+        * @return bool
         */
        function isHappy() {
                return $this->mSize < $this->mMaxSize 
index 17b348d..cf5ea7c 100644 (file)
@@ -15,6 +15,8 @@ class LBFactory_Single extends LBFactory {
        }
 
        /**
+        * @param $wiki
+        *
         * @return LoadBalancer_Single
         */
        function newMainLB( $wiki = false ) {
@@ -22,6 +24,8 @@ class LBFactory_Single extends LBFactory {
        }
 
        /**
+        * @param $wiki
+        *
         * @return LoadBalancer_Single
         */
        function getMainLB( $wiki = false ) {
@@ -29,6 +33,9 @@ class LBFactory_Single extends LBFactory {
        }
 
        /**
+        * @param $cluster
+        * @param $wiki
+        *
         * @return LoadBalancer_Single
         */
        function newExternalLB( $cluster, $wiki = false ) {
@@ -36,12 +43,19 @@ class LBFactory_Single extends LBFactory {
        }
 
        /**
+        * @param $cluster
+        * @param $wiki
+        *
         * @return LoadBalancer_Single
         */
        function &getExternalLB( $cluster, $wiki = false ) {
                return $this->lb;
        }
 
+       /**
+        * @param $callback string|array
+        * @param $params array
+        */
        function forEachLB( $callback, $params = array() ) {
                call_user_func_array( $callback, array_merge( array( $this->lb ), $params ) );
        }
@@ -57,6 +71,9 @@ class LoadBalancer_Single extends LoadBalancer {
         */
        var $db;
 
+       /**
+        * @param $params array
+        */
        function __construct( $params ) {
                $this->db = $params['connection'];
                parent::__construct( array( 'servers' => array( array(
index 5f04ea7..09bee39 100644 (file)
  * @ingroup FileRepo
  */
 class ForeignDBFile extends LocalFile {
+
+       /**
+        * @param $title
+        * @param $repo
+        * @param $unused
+        * @return ForeignDBFile
+        */
        static function newFromTitle( $title, $repo, $unused = null ) {
                return new self( $title, $repo );
        }
@@ -19,6 +26,11 @@ class ForeignDBFile extends LocalFile {
        /**
         * Create a ForeignDBFile from a title
         * Do not call this except from inside a repo class.
+        *
+        * @param $row
+        * @param $repo
+        *
+        * @return ForeignDBFile
         */
        static function newFromRow( $row, $repo ) {
                $title = Title::makeTitle( NS_FILE, $row->img_name );
@@ -35,21 +47,30 @@ class ForeignDBFile extends LocalFile {
                $watch = false, $timestamp = false ) {
                $this->readOnlyError();
        }
+
        function restore( $versions = array(), $unsuppress = false ) {
                $this->readOnlyError();
        }
+
        function delete( $reason, $suppress = false ) {
                $this->readOnlyError();
        }
+
        function move( $target ) {
                $this->readOnlyError();
        }
-       
+
+       /**
+        * @return string
+        */
        function getDescriptionUrl() {
                // Restore remote behaviour
                return File::getDescriptionUrl();
        }
 
+       /**
+        * @return string
+        */
        function getDescriptionText() {
                // Restore remote behaviour
                return File::getDescriptionText();
index 51e3194..64710ce 100644 (file)
@@ -17,6 +17,8 @@ class TiffHandler extends JpegOrTiffHandler {
         * Conversion to PNG for inline display can be disabled here...
         * Note scaling should work with ImageMagick, but may not with GD scaling.
         *
+        * @param $file
+        *
         * @return bool
         */
        function canRender( $file ) {
@@ -28,6 +30,8 @@ class TiffHandler extends JpegOrTiffHandler {
         * Browsers don't support TIFF inline generally...
         * For inline display, we need to convert to PNG.
         *
+        * @param $file
+        *
         * @return bool
         */
        function mustRender( $file ) {
@@ -35,9 +39,9 @@ class TiffHandler extends JpegOrTiffHandler {
        }
 
        /**
-        * @param  $ext
-        * @param  $mime
-        * @param null $params
+        * @param $ext
+        * @param $mime
+        * @param $params
         * @return bool
         */
        function getThumbType( $ext, $mime, $params = null ) {
index 21bbe47..39da818 100644 (file)
@@ -26,9 +26,8 @@ class CacheTime {
         * setCacheTime() sets the timestamp expressing when the page has been rendered. 
         * This doesn not control expiry, see updateCacheExpiry() for that!
         */
-       function setCacheTime( $t )          { return wfSetVar( $this->mCacheTime, $t ); } 
+       function setCacheTime( $t )          { return wfSetVar( $this->mCacheTime, $t ); }
 
-               
        /** 
         * Sets the number of seconds after which this object should expire.
         * This value is used with the ParserCache.
@@ -40,12 +39,14 @@ class CacheTime {
        function updateCacheExpiry( $seconds ) { 
                $seconds = (int)$seconds;
 
-               if ( $this->mCacheExpiry === null || $this->mCacheExpiry > $seconds ) 
-                       $this->mCacheExpiry = $seconds; 
+               if ( $this->mCacheExpiry === null || $this->mCacheExpiry > $seconds ) {
+                       $this->mCacheExpiry = $seconds;
+               }
 
                // hack: set old-style marker for uncacheable entries.
-               if ( $this->mCacheExpiry !== null && $this->mCacheExpiry <= 0 ) 
+               if ( $this->mCacheExpiry !== null && $this->mCacheExpiry <= 0 ) {
                        $this->mCacheTime = -1;
+               }
        }
        
        /**
@@ -59,28 +60,36 @@ class CacheTime {
        function getCacheExpiry() { 
                global $wgParserCacheExpireTime;
 
-               if ( $this->mCacheTime < 0 ) return 0; // old-style marker for "not cachable"
+               if ( $this->mCacheTime < 0 ) {
+                       return 0;
+               } // old-style marker for "not cachable"
 
                $expire = $this->mCacheExpiry; 
 
-               if ( $expire === null ) 
+               if ( $expire === null ) {
                        $expire = $wgParserCacheExpireTime;
-               else
+               } else {
                        $expire = min( $expire, $wgParserCacheExpireTime );
+               }
 
                if( $this->containsOldMagic() ) { //compatibility hack
                        $expire = min( $expire, 3600 ); # 1 hour
                } 
 
-               if ( $expire <= 0 ) return 0; // not cachable
-               else return $expire;
+               if ( $expire <= 0 ) {
+                       return 0; // not cachable
+               } else {
+                       return $expire;
+               }
        }
 
-
+       /**
+        * @return bool
+        */
        function isCacheable() { 
                return $this->getCacheExpiry() > 0;
        }
-       
+
        /**
         * Return true if this cached output object predates the global or
         * per-article cache invalidation timestamps, or if it comes from
index 8eac6f0..1e9343b 100644 (file)
@@ -9,7 +9,11 @@
  * @ingroup Parser
  */
 interface Preprocessor {
-       /** Create a new preprocessor object based on an initialised Parser object */
+       /**
+        * Create a new preprocessor object based on an initialised Parser object
+        *
+        * @param $parser Parser
+        */
        function __construct( $parser );
 
        /**
@@ -28,12 +32,19 @@ interface Preprocessor {
         */
        function newCustomFrame( $args );
 
-       /** Create a new custom node for programmatic use of parameter replacement as used in some extensions */
+       /**
+        * Create a new custom node for programmatic use of parameter replacement as used in some extensions
+        *
+        * @param $values
+        */
        function newPartNodeArray( $values );
 
        /**
         * Preprocess text to a PPNode
         *
+        * @param $text
+        * @param $flags
+        * 
         * @return PPNode
         */
        function preprocessToObj( $text, $flags = 0 );
@@ -54,6 +65,9 @@ interface PPFrame {
        /**
         * Create a child frame
         *
+        * @param $args array
+        * @param $title Title
+        *
         * @return PPFrame
         */
        function newChild( $args = false, $title = false );
@@ -86,6 +100,8 @@ interface PPFrame {
 
        /**
         * Returns true if there are no arguments in this frame
+        *
+        * @return bool
         */
        function isEmpty();
 
@@ -111,6 +127,8 @@ interface PPFrame {
 
        /**
         * Returns true if the infinite loop check is OK, false if a loop is detected
+        *
+        * @return bool
         */
        function loopCheck( $title );