r86915 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r86914‎ | r86915 | r86916 >
Date:22:41, 25 April 2011
Author:reedy
Status:resolved
Tags:
Comment:
More parameter and return type hints
Modified paths:
  • /trunk/phase3/includes/Cdb.php (modified) (history)
  • /trunk/phase3/includes/SquidPurgeClient.php (modified) (history)
  • /trunk/phase3/includes/cache/LinkCache.php (modified) (history)
  • /trunk/phase3/includes/cache/MessageCache.php (modified) (history)
  • /trunk/phase3/includes/cache/SquidUpdate.php (modified) (history)
  • /trunk/phase3/includes/objectcache/MemcachedPhpBagOStuff.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/objectcache/MemcachedPhpBagOStuff.php
@@ -20,6 +20,8 @@
2121 * - compress_threshold: The minimum size an object must be before it is compressed
2222 * - timeout: The read timeout in microseconds
2323 * - connect_timeout: The connect timeout in seconds
 24+ *
 25+ * @params $params array
2426 */
2527 function __construct( $params ) {
2628 if ( !isset( $params['servers'] ) ) {
Index: trunk/phase3/includes/SquidPurgeClient.php
@@ -139,6 +139,8 @@
140140
141141 /**
142142 * Queue a purge operation
 143+ *
 144+ * @param $url string
143145 */
144146 public function queuePurge( $url ) {
145147 $url = str_replace( "\n", '', $url );
@@ -151,6 +153,9 @@
152154 }
153155 }
154156
 157+ /**
 158+ * @return bool
 159+ */
155160 public function isIdle() {
156161 return strlen( $this->writeBuffer ) == 0 && $this->readState == 'idle';
157162 }
Index: trunk/phase3/includes/Cdb.php
@@ -13,6 +13,10 @@
1414 abstract class CdbReader {
1515 /**
1616 * Open a file and return a subclass instance
 17+ *
 18+ * @param $fileName string
 19+ *
 20+ * @return CdbReader
1721 */
1822 public static function open( $fileName ) {
1923 if ( self::haveExtension() ) {
@@ -25,6 +29,8 @@
2630
2731 /**
2832 * Returns true if the native extension is available
 33+ *
 34+ * @return bool
2935 */
3036 public static function haveExtension() {
3137 if ( !function_exists( 'dba_handlers' ) ) {
@@ -61,6 +67,10 @@
6268 /**
6369 * Open a writer and return a subclass instance.
6470 * The user must have write access to the directory, for temporary file creation.
 71+ *
 72+ * @param $fileName string
 73+ *
 74+ * @return bool
6575 */
6676 public static function open( $fileName ) {
6777 if ( CdbReader::haveExtension() ) {
Index: trunk/phase3/includes/cache/LinkCache.php
@@ -14,6 +14,8 @@
1515
1616 /**
1717 * Get an instance of this class
 18+ *
 19+ * @return LinkCache
1820 */
1921 static function &singleton() {
2022 static $instance;
Index: trunk/phase3/includes/cache/MessageCache.php
@@ -64,6 +64,8 @@
6565
6666 /**
6767 * Singleton instance
 68+ *
 69+ * @var MessageCache
6870 */
6971 private static $instance;
7072
Index: trunk/phase3/includes/cache/SquidUpdate.php
@@ -25,6 +25,11 @@
2626 $this->urlArr = $urlArr;
2727 }
2828
 29+ /**
 30+ * @param $title Title
 31+ *
 32+ * @return SquidUpdate
 33+ */
2934 static function newFromLinksTo( &$title ) {
3035 global $wgMaxSquidPurgeTitles;
3136 wfProfileIn( __METHOD__ );
@@ -52,6 +57,11 @@
5358
5459 /**
5560 * Create a SquidUpdate from an array of Title objects, or a TitleArray object
 61+ *
 62+ * @param $titles array
 63+ * @param $urlArr array
 64+ *
 65+ * @return SquidUpdate
5666 */
5767 static function newFromTitles( $titles, $urlArr = array() ) {
5868 global $wgMaxSquidPurgeTitles;
@@ -65,6 +75,11 @@
6676 return new SquidUpdate( $urlArr );
6777 }
6878
 79+ /**
 80+ * @param $title Title
 81+ *
 82+ * @return SquidUpdate
 83+ */
6984 static function newSimplePurge( &$title ) {
7085 $urlArr = $title->getSquidURLs();
7186 return new SquidUpdate( $urlArr );
@@ -74,11 +89,15 @@
7590 SquidUpdate::purge( $this->urlArr );
7691 }
7792
78 - /* Purges a list of Squids defined in $wgSquidServers.
79 - $urlArr should contain the full URLs to purge as values
80 - (example: $urlArr[] = 'http://my.host/something')
81 - XXX report broken Squids per mail or log */
82 -
 93+ /**
 94+ * Purges a list of Squids defined in $wgSquidServers.
 95+ * $urlArr should contain the full URLs to purge as values
 96+ * (example: $urlArr[] = 'http://my.host/something')
 97+ * XXX report broken Squids per mail or log
 98+ *
 99+ * @param $urlArr array
 100+ * @return void
 101+ */
83102 static function purge( $urlArr ) {
84103 global $wgSquidServers, $wgHTCPMulticastAddress, $wgHTCPPort;
85104
@@ -124,7 +143,7 @@
125144 global $wgHTCPMulticastAddress, $wgHTCPMulticastTTL, $wgHTCPPort;
126145 wfProfileIn( __METHOD__ );
127146
128 - $htcpOpCLR = 4; // HTCP CLR
 147+ $htcpOpCLR = 4; // HTCP CLR
129148
130149 // FIXME PHP doesn't support these socket constants (include/linux/in.h)
131150 if( !defined( "IPPROTO_IP" ) ) {
@@ -190,6 +209,8 @@
191210 *
192211 * Client functions should not need to call this.
193212 *
 213+ * @param $url string
 214+ *
194215 * @return string
195216 */
196217 static function expand( $url ) {

Status & tagging log