More parameter and return type hints
authorSam Reed <reedy@users.mediawiki.org>
Mon, 25 Apr 2011 22:41:54 +0000 (22:41 +0000)
committerSam Reed <reedy@users.mediawiki.org>
Mon, 25 Apr 2011 22:41:54 +0000 (22:41 +0000)
includes/Cdb.php
includes/SquidPurgeClient.php
includes/cache/LinkCache.php
includes/cache/MessageCache.php
includes/cache/SquidUpdate.php
includes/objectcache/MemcachedPhpBagOStuff.php

index 6047748..8f93560 100644 (file)
 abstract class CdbReader {
        /**
         * Open a file and return a subclass instance
+        *
+        * @param $fileName string
+        *
+        * @return CdbReader
         */
        public static function open( $fileName ) {
                if ( self::haveExtension() ) {
@@ -25,6 +29,8 @@ abstract class CdbReader {
 
        /**
         * Returns true if the native extension is available
+        *
+        * @return bool
         */
        public static function haveExtension() {
                if ( !function_exists( 'dba_handlers' ) ) {
@@ -61,6 +67,10 @@ abstract class CdbWriter {
        /**
         * Open a writer and return a subclass instance.
         * The user must have write access to the directory, for temporary file creation.
+        *
+        * @param $fileName string
+        *
+        * @return bool
         */
        public static function open( $fileName ) {
                if ( CdbReader::haveExtension() ) {
index d439b58..664f59a 100644 (file)
@@ -139,6 +139,8 @@ class SquidPurgeClient {
 
        /**
         * Queue a purge operation
+        *
+        * @param $url string
         */
        public function queuePurge( $url ) {
                $url = str_replace( "\n", '', $url );
@@ -151,6 +153,9 @@ class SquidPurgeClient {
                }
        }
 
+       /**
+        * @return bool
+        */
        public function isIdle() {
                return strlen( $this->writeBuffer ) == 0 && $this->readState == 'idle';
        }
index f3dea93..0e1029e 100644 (file)
@@ -14,6 +14,8 @@ class LinkCache {
 
        /**
         * Get an instance of this class
+        *
+        * @return LinkCache
         */
        static function &singleton() {
                static $instance;
index a498fca..3e0668c 100644 (file)
@@ -64,6 +64,8 @@ class MessageCache {
 
        /**
         * Singleton instance
+        *
+        * @var MessageCache
         */
        private static $instance;
 
index 91f1d28..dddc7b8 100644 (file)
@@ -25,6 +25,11 @@ class SquidUpdate {
                $this->urlArr = $urlArr;
        }
 
+       /**
+        * @param $title Title
+        * 
+        * @return SquidUpdate
+        */
        static function newFromLinksTo( &$title ) {
                global $wgMaxSquidPurgeTitles;
                wfProfileIn( __METHOD__ );
@@ -52,6 +57,11 @@ class SquidUpdate {
 
        /**
         * Create a SquidUpdate from an array of Title objects, or a TitleArray object
+        *
+        * @param $titles array
+        * @param $urlArr array
+        *
+        * @return SquidUpdate
         */
        static function newFromTitles( $titles, $urlArr = array() ) {
                global $wgMaxSquidPurgeTitles;
@@ -65,6 +75,11 @@ class SquidUpdate {
                return new SquidUpdate( $urlArr );
        }
 
+       /**
+        * @param $title Title
+        *
+        * @return SquidUpdate
+        */
        static function newSimplePurge( &$title ) {
                $urlArr = $title->getSquidURLs();
                return new SquidUpdate( $urlArr );
@@ -74,11 +89,15 @@ class SquidUpdate {
                SquidUpdate::purge( $this->urlArr );
        }
 
-       /* Purges a list of Squids defined in $wgSquidServers.
-       $urlArr should contain the full URLs to purge as values
-       (example: $urlArr[] = 'http://my.host/something')
-       XXX report broken Squids per mail or log */
-
+       /**
+        * Purges a list of Squids defined in $wgSquidServers.
+        * $urlArr should contain the full URLs to purge as values
+        * (example: $urlArr[] = 'http://my.host/something')
+        * XXX report broken Squids per mail or log
+        *
+        * @param $urlArr array
+        * @return void
+        */
        static function purge( $urlArr ) {
                global $wgSquidServers, $wgHTCPMulticastAddress, $wgHTCPPort;
 
@@ -124,7 +143,7 @@ class SquidUpdate {
                global $wgHTCPMulticastAddress, $wgHTCPMulticastTTL, $wgHTCPPort;
                wfProfileIn( __METHOD__ );
 
-               $htcpOpCLR = 4;                 // HTCP CLR
+               $htcpOpCLR = 4; // HTCP CLR
 
                // FIXME PHP doesn't support these socket constants (include/linux/in.h)
                if( !defined( "IPPROTO_IP" ) ) {
@@ -190,6 +209,8 @@ class SquidUpdate {
         *
         * Client functions should not need to call this.
         *
+        * @param $url string
+        *
         * @return string
         */
        static function expand( $url ) {
index 73281c8..17d1292 100644 (file)
@@ -20,6 +20,8 @@ class MemcachedPhpBagOStuff extends BagOStuff {
         *   - compress_threshold:  The minimum size an object must be before it is compressed
         *   - timeout:             The read timeout in microseconds
         *   - connect_timeout:     The connect timeout in seconds
+        *
+        * @params $params array
         */
        function __construct( $params ) {
                if ( !isset( $params['servers'] ) ) {