r111102 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r111101‎ | r111102 | r111103 >
Date:21:35, 9 February 2012
Author:reedy
Status:ok
Tags:
Comment:
More return documentation
Modified paths:
  • /trunk/phase3/includes/Init.php (modified) (history)
  • /trunk/phase3/includes/Linker.php (modified) (history)
  • /trunk/phase3/includes/LocalisationCache.php (modified) (history)
  • /trunk/phase3/includes/MimeMagic.php (modified) (history)
  • /trunk/phase3/includes/Namespace.php (modified) (history)
  • /trunk/phase3/includes/OutputPage.php (modified) (history)
  • /trunk/phase3/includes/PoolCounter.php (modified) (history)
  • /trunk/phase3/includes/installer/DatabaseInstaller.php (modified) (history)
  • /trunk/phase3/includes/installer/Installer.php (modified) (history)
  • /trunk/phase3/includes/installer/OracleInstaller.php (modified) (history)
  • /trunk/phase3/includes/installer/PostgresInstaller.php (modified) (history)
  • /trunk/phase3/includes/installer/PostgresUpdater.php (modified) (history)
  • /trunk/phase3/includes/installer/WebInstaller.php (modified) (history)
  • /trunk/phase3/includes/installer/WebInstallerPage.php (modified) (history)
  • /trunk/phase3/includes/json/Services_JSON.php (modified) (history)
  • /trunk/phase3/includes/logging/LogEntry.php (modified) (history)
  • /trunk/phase3/includes/logging/LogFormatter.php (modified) (history)
  • /trunk/phase3/includes/logging/LogPager.php (modified) (history)
  • /trunk/phase3/includes/media/Bitmap.php (modified) (history)
  • /trunk/phase3/includes/media/DjVu.php (modified) (history)
  • /trunk/phase3/includes/media/DjVuImage.php (modified) (history)
  • /trunk/phase3/includes/media/Exif.php (modified) (history)
  • /trunk/phase3/includes/media/Generic.php (modified) (history)
  • /trunk/phase3/includes/media/MediaTransformOutput.php (modified) (history)
  • /trunk/phase3/includes/media/SVGMetadataExtractor.php (modified) (history)
  • /trunk/phase3/includes/normal/UtfNormal.php (modified) (history)
  • /trunk/phase3/includes/normal/UtfNormalTest.php (modified) (history)
  • /trunk/phase3/includes/normal/UtfNormalTest2.php (modified) (history)
  • /trunk/phase3/includes/objectcache/BagOStuff.php (modified) (history)
  • /trunk/phase3/includes/objectcache/MemcachedClient.php (modified) (history)
  • /trunk/phase3/includes/objectcache/MemcachedPhpBagOStuff.php (modified) (history)
  • /trunk/phase3/includes/objectcache/MultiWriteBagOStuff.php (modified) (history)
  • /trunk/phase3/includes/objectcache/SqlBagOStuff.php (modified) (history)
  • /trunk/phase3/includes/parser/CoreParserFunctions.php (modified) (history)
  • /trunk/phase3/includes/parser/DateFormatter.php (modified) (history)
  • /trunk/phase3/includes/parser/LinkHolderArray.php (modified) (history)
  • /trunk/phase3/includes/parser/Parser.php (modified) (history)
  • /trunk/phase3/includes/parser/ParserCache.php (modified) (history)
  • /trunk/phase3/includes/parser/ParserOptions.php (modified) (history)
  • /trunk/phase3/includes/parser/ParserOutput.php (modified) (history)
  • /trunk/phase3/includes/parser/Preprocessor_DOM.php (modified) (history)
  • /trunk/phase3/includes/profiler/Profiler.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/json/Services_JSON.php
@@ -826,6 +826,7 @@
827827
828828 /**
829829 * @todo Ultimately, this should just call PEAR::isError()
 830+ * @return bool
830831 */
831832 function isError($data, $code = null)
832833 {
Index: trunk/phase3/includes/MimeMagic.php
@@ -566,6 +566,7 @@
567567 *
568568 * @param string $file
569569 * @param mixed $ext
 570+ * @return bool|string
570571 */
571572 private function doGuessMimeType( $file, $ext ) { // TODO: remove $ext param
572573 // Read a chunk of the file
@@ -1030,6 +1031,7 @@
10311032 *
10321033 * This funktion relies on the mapping defined by $this->mMediaTypes
10331034 * @access private
 1035+ * @return int|string
10341036 */
10351037 function findMediaType( $extMime ) {
10361038 if ( strpos( $extMime, '.' ) === 0 ) {
@@ -1067,6 +1069,7 @@
10681070 * @param $fileName String: the file name (unused at present)
10691071 * @param $chunk String: the first 256 bytes of the file
10701072 * @param $proposed String: the MIME type proposed by the server
 1073+ * @return Array
10711074 */
10721075 public function getIEMimeTypes( $fileName, $chunk, $proposed ) {
10731076 $ca = $this->getIEContentAnalyzer();
Index: trunk/phase3/includes/objectcache/MemcachedPhpBagOStuff.php
@@ -153,6 +153,7 @@
154154 * the other control characters for compatibility with libmemcached
155155 * verify_key. We leave other punctuation alone, to maximise backwards
156156 * compatibility.
 157+ * @return string
157158 */
158159 public function encodeKey( $key ) {
159160 return preg_replace_callback( '/[\x00-\x20\x25\x7f]+/',
Index: trunk/phase3/includes/objectcache/BagOStuff.php
@@ -155,6 +155,7 @@
156156
157157 /**
158158 * Convert an optionally relative time to an absolute time
 159+ * @return int
159160 */
160161 protected function convertExpiry( $exptime ) {
161162 if ( ( $exptime != 0 ) && ( $exptime < 86400 * 3650 /* 10 years */ ) ) {
Index: trunk/phase3/includes/objectcache/SqlBagOStuff.php
@@ -92,6 +92,7 @@
9393
9494 /**
9595 * Get the table name for a given key
 96+ * @return string
9697 */
9798 protected function getTableByKey( $key ) {
9899 if ( $this->shards > 1 ) {
@@ -104,6 +105,7 @@
105106
106107 /**
107108 * Get the table name for a given shard index
 109+ * @return string
108110 */
109111 protected function getTableByShard( $index ) {
110112 if ( $this->shards > 1 ) {
@@ -310,6 +312,7 @@
311313
312314 /**
313315 * Delete objects from the database which expire before a certain date.
 316+ * @return bool
314317 */
315318 public function deleteObjectsExpiringBefore( $timestamp, $progressCallback = false ) {
316319 $db = $this->getDB();
Index: trunk/phase3/includes/objectcache/MemcachedClient.php
@@ -871,6 +871,7 @@
872872 * @param $sock Resource: socket to read from
873873 * @param $ret Array: returned values
874874 *
 875+ * @return bool|int
875876 * @access private
876877 */
877878 function _load_items( $sock, &$ret ) {
@@ -1079,6 +1080,7 @@
10801081
10811082 /**
10821083 * Original behaviour
 1084+ * @return int
10831085 */
10841086 function _safe_fwrite( $f, $buf, $len = false ) {
10851087 if ( $len === false ) {
Index: trunk/phase3/includes/objectcache/MultiWriteBagOStuff.php
@@ -100,6 +100,7 @@
101101 * Delete objects expiring before a certain date.
102102 *
103103 * Succeed if any of the child caches succeed.
 104+ * @return bool
104105 */
105106 public function deleteObjectsExpiringBefore( $date, $progressCallback = false ) {
106107 $ret = false;
Index: trunk/phase3/includes/LocalisationCache.php
@@ -343,6 +343,7 @@
344344
345345 /**
346346 * Returns true if the cache identified by $code is missing or expired.
 347+ * @return bool
347348 */
348349 public function isExpired( $code ) {
349350 if ( $this->forceRecache && !isset( $this->recachedLangs[$code] ) ) {
Index: trunk/phase3/includes/parser/LinkHolderArray.php
@@ -33,7 +33,8 @@
3434 * serializing at present.
3535 *
3636 * Compact the titles, only serialize the text form.
37 - */
 37+ * @return array
 38+ */
3839 function __sleep() {
3940 foreach ( $this->internals as &$nsLinks ) {
4041 foreach ( $nsLinks as &$entry ) {
@@ -134,6 +135,7 @@
135136 /**
136137 * Get a subset of the current LinkHolderArray which is sufficient to
137138 * interpret the given text.
 139+ * @return \LinkHolderArray
138140 */
139141 function getSubArray( $text ) {
140142 $sub = new LinkHolderArray( $this->parent );
@@ -167,6 +169,7 @@
168170
169171 /**
170172 * Returns true if the memory requirements of this object are getting large
 173+ * @return bool
171174 */
172175 function isBig() {
173176 global $wgLinkHolderBatchSize;
@@ -190,6 +193,7 @@
191194 * article length checks (for stub links) to be bundled into a single query.
192195 *
193196 * @param $nt Title
 197+ * @return string
194198 */
195199 function makeHolder( $nt, $text = '', $query = array(), $trail = '', $prefix = '' ) {
196200 wfProfileIn( __METHOD__ );
Index: trunk/phase3/includes/parser/Parser.php
@@ -494,6 +494,7 @@
495495 /**
496496 * Expand templates and variables in the text, producing valid, static wikitext.
497497 * Also removes comments.
 498+ * @return mixed|string
498499 */
499500 function preprocess( $text, Title $title, ParserOptions $options, $revid = null ) {
500501 wfProfileIn( __METHOD__ );
@@ -840,6 +841,7 @@
841842 * parse the wiki syntax used to render tables
842843 *
843844 * @private
 845+ * @return string
844846 */
845847 function doTableStuff( $text ) {
846848 wfProfileIn( __METHOD__ );
@@ -3892,6 +3894,7 @@
38933895 * @param $text String
38943896 * @param $origText String: original, untouched wikitext
38953897 * @param $isMain Boolean
 3898+ * @return mixed|string
38963899 * @private
38973900 */
38983901 function formatHeadings( $text, $origText, $isMain=true ) {
@@ -4711,6 +4714,7 @@
47124715 * Create a tag function, e.g. <test>some stuff</test>.
47134716 * Unlike tag hooks, tag functions are parsed at preprocessor level.
47144717 * Unlike parser functions, their content is not preprocessed.
 4718+ * @return null
47154719 */
47164720 function setFunctionTagHook( $tag, $callback, $flags ) {
47174721 $tag = strtolower( $tag );
Index: trunk/phase3/includes/parser/CoreParserFunctions.php
@@ -154,6 +154,7 @@
155155 * @param $parser Parser object
156156 * @param $s String: The text to encode.
157157 * @param $arg String (optional): The type of encoding.
 158+ * @return string
158159 */
159160 static function urlencode( $parser, $s = '', $arg = null ) {
160161 static $magicWords = null;
@@ -418,6 +419,7 @@
419420 * corresponding magic word
420421 * Note: function name changed to "mwnamespace" rather than "namespace"
421422 * to not break PHP 5.3
 423+ * @return mixed|string
422424 */
423425 static function mwnamespace( $parser, $title = null ) {
424426 $t = Title::newFromText( $title );
@@ -459,6 +461,7 @@
460462 /**
461463 * Functions to get and normalize pagenames, corresponding to the magic words
462464 * of the same names
 465+ * @return String
463466 */
464467 static function pagename( $parser, $title = null ) {
465468 $t = Title::newFromText( $title );
@@ -537,6 +540,7 @@
538541 * Return the number of pages in the given category, or 0 if it's nonexis-
539542 * tent. This is an expensive parser function and can't be called too many
540543 * times per page.
 544+ * @return string
541545 */
542546 static function pagesincategory( $parser, $name = '', $raw = null ) {
543547 static $cache = array();
@@ -574,6 +578,7 @@
575579 * @param $parser Parser
576580 * @param $page String TODO DOCUMENT (Default: empty string)
577581 * @param $raw TODO DOCUMENT (Default: null)
 582+ * @return string
578583 */
579584 static function pagesize( $parser, $page = '', $raw = null ) {
580585 static $cache = array();
@@ -603,7 +608,8 @@
604609
605610 /**
606611 * Returns the requested protection level for the current page
607 - */
 612+ * @return string
 613+ */
608614 static function protectionlevel( $parser, $type = '' ) {
609615 $restrictions = $parser->mTitle->getRestrictions( strtolower( $type ) );
610616 # Title::getRestrictions returns an array, its possible it may have
@@ -634,6 +640,7 @@
635641
636642 /**
637643 * Unicode-safe str_pad with the restriction that $length is forced to be <= 500
 644+ * @return string
638645 */
639646 static function pad( $string, $length, $padding = '0', $direction = STR_PAD_RIGHT ) {
640647 $lengthOfPadding = mb_strlen( $padding );
@@ -764,6 +771,7 @@
765772
766773 /**
767774 * Parser function to extension tag adaptor
 775+ * @return string
768776 */
769777 public static function tagObj( $parser, $frame, $args ) {
770778 if ( !count( $args ) ) {
Index: trunk/phase3/includes/parser/DateFormatter.php
@@ -122,6 +122,7 @@
123123 * @param $preference String: User preference
124124 * @param $text String: Text to reformat
125125 * @param $options Array: can contain 'linked' and/or 'match-whole'
 126+ * @return mixed|String
126127 */
127128 function reformat( $preference, $text, $options = array('linked') ) {
128129
@@ -172,6 +173,7 @@
173174
174175 /**
175176 * @param $matches
 177+ * @return string
176178 */
177179 function replace( $matches ) {
178180 # Extract information from $matches
@@ -282,6 +284,7 @@
283285
284286 /**
285287 * @todo document
 288+ * @return string
286289 */
287290 function getMonthRegex() {
288291 global $wgContLang;
@@ -325,6 +328,7 @@
326329
327330 /**
328331 * @todo document
 332+ * @return int|string
329333 */
330334 function makeNormalYear( $iso ) {
331335 if ( $iso[0] == '-' ) {
Index: trunk/phase3/includes/parser/ParserOptions.php
@@ -428,6 +428,7 @@
429429 * Returns the full array of options that would have been used by
430430 * in 1.16.
431431 * Used to get the old parser cache entries when available.
 432+ * @return array
432433 */
433434 public static function legacyOptions() {
434435 global $wgUseDynamicDates;
Index: trunk/phase3/includes/parser/ParserOutput.php
@@ -60,6 +60,7 @@
6161 * The value returned by getCacheExpiry is smaller or equal to the smallest number
6262 * that was provided to a call of updateCacheExpiry(), and smaller or equal to the
6363 * value of $wgParserCacheExpireTime.
 64+ * @return int|mixed|null
6465 */
6566 function getCacheExpiry() {
6667 global $wgParserCacheExpireTime;
@@ -166,6 +167,7 @@
167168 /**
168169 * callback used by getText to replace editsection tokens
169170 * @private
 171+ * @return mixed
170172 */
171173 function replaceEditSectionLinksCallback( $m ) {
172174 global $wgOut, $wgLang;
Index: trunk/phase3/includes/parser/ParserCache.php
@@ -77,6 +77,7 @@
7878 *
7979 * @param $article Article
8080 * @param $popts ParserOptions
 81+ * @return string
8182 */
8283 function getETag( $article, $popts ) {
8384 return 'W/"' . $this->getParserOutputKey( $article,
@@ -104,6 +105,7 @@
105106 *
106107 * @param $article Article
107108 * @param $popts ParserOptions
 109+ * @return bool|mixed|string
108110 */
109111 public function getKey( $article, $popts, $useOutdated = true ) {
110112 global $wgCacheEpoch;
Index: trunk/phase3/includes/parser/Preprocessor_DOM.php
@@ -1250,6 +1250,7 @@
12511251
12521252 /**
12531253 * Virtual implode with brackets
 1254+ * @return array
12541255 */
12551256 function virtualBracketedImplode( $start, $sep, $end /*, ... */ ) {
12561257 $args = array_slice( func_get_args(), 3 );
@@ -1674,6 +1675,7 @@
16751676
16761677 /**
16771678 * Split a <h> node
 1679+ * @return array
16781680 */
16791681 function splitHeading() {
16801682 if ( $this->getName() !== 'h' ) {
Index: trunk/phase3/includes/Linker.php
@@ -20,6 +20,7 @@
2121 *
2222 * @param $class String: the contents of the class attribute; if an empty
2323 * string is passed, which is the default value, defaults to 'external'.
 24+ * @return string
2425 * @deprecated since 1.18 Just pass the external class directly to something using Html::expandAttributes
2526 */
2627 static function getExternalLinkAttributes( $class = 'external' ) {
@@ -36,6 +37,7 @@
3738 * @param $unused String: unused
3839 * @param $class String: the contents of the class attribute; if an empty
3940 * string is passed, which is the default value, defaults to 'external'.
 41+ * @return string
4042 */
4143 static function getInterwikiLinkAttributes( $title, $unused = null, $class = 'external' ) {
4244 global $wgContLang;
@@ -57,6 +59,7 @@
5860 * not HTML-escaped
5961 * @param $unused String: unused
6062 * @param $class String: the contents of the class attribute, default none
 63+ * @return string
6164 */
6265 static function getInternalLinkAttributes( $title, $unused = null, $class = '' ) {
6366 $title = urldecode( $title );
@@ -73,6 +76,7 @@
7477 * @param $class String: the contents of the class attribute, default none
7578 * @param $title Mixed: optional (unescaped) string to use in the title
7679 * attribute; if false, default to the name of the page we're linking to
 80+ * @return string
7781 */
7882 static function getInternalLinkAttributesObj( $nt, $unused = null, $class = '', $title = false ) {
7983 if ( $title === false ) {
@@ -229,6 +233,7 @@
230234
231235 /**
232236 * Identical to link(), except $options defaults to 'known'.
 237+ * @return string
233238 */
234239 public static function linkKnown(
235240 $target, $html = null, $customAttribs = array(),
@@ -243,6 +248,7 @@
244249 * @param $target Title
245250 * @param $query Array: query parameters
246251 * @param $options Array
 252+ * @return String
247253 */
248254 private static function linkUrl( $target, $query, $options ) {
249255 wfProfileIn( __METHOD__ );
@@ -641,6 +647,7 @@
642648 * @param $params Array
643649 * @param $framed Boolean
644650 * @param $manualthumb String
 651+ * @return mixed
645652 */
646653 public static function makeThumbLinkObj( Title $title, $file, $label = '', $alt,
647654 $align = 'right', $params = array(), $framed = false , $manualthumb = "" )
@@ -893,6 +900,7 @@
894901 * @param $escape Boolean: do we escape the link text?
895902 * @param $linktype String: type of external link. Gets added to the classes
896903 * @param $attribs Array of extra attributes to <a>
 904+ * @return string
897905 */
898906 public static function makeExternalLink( $url, $text, $escape = true, $linktype = '', $attribs = array() ) {
899907 $class = "external";
@@ -998,6 +1006,7 @@
9991007 * @param $userId Integer: user identifier
10001008 * @param $userText String: user name or IP address
10011009 * @param $edits Integer: user edit count (optional, for performance)
 1010+ * @return String
10021011 */
10031012 public static function userToolLinksRedContribs( $userId, $userText, $edits = null ) {
10041013 return self::userToolLinks( $userId, $userText, true, 0, $edits );
@@ -1096,6 +1105,7 @@
10971106 * @param $comment String
10981107 * @param $title Mixed: Title object (to generate link to the section in autocomment) or null
10991108 * @param $local Boolean: whether section links should refer to local page
 1109+ * @return mixed|String
11001110 */
11011111 public static function formatComment( $comment, $title = null, $local = false ) {
11021112 wfProfileIn( __METHOD__ );
@@ -1474,6 +1484,7 @@
14751485 * End a Table Of Contents line.
14761486 * tocUnindent() will be used instead if we're ending a line below
14771487 * the new level.
 1488+ * @return string
14781489 */
14791490 public static function tocLineEnd() {
14801491 return "</li>\n";
@@ -1552,6 +1563,7 @@
15531564 /**
15541565 * Split a link trail, return the "inside" portion and the remainder of the trail
15551566 * as a two-element array
 1567+ * @return array
15561568 */
15571569 static function splitTrail( $trail ) {
15581570 global $wgContLang;
@@ -1579,6 +1591,7 @@
15801592 * other users.
15811593 *
15821594 * @param $rev Revision object
 1595+ * @return string
15831596 */
15841597 public static function generateRollback( $rev ) {
15851598 return '<span class="mw-rollback-link">['
@@ -1886,6 +1899,7 @@
18871900 * @param $trail String: Optional trail. Alphabetic characters at the start of this string will
18881901 * be included in the link text. Other characters will be appended after
18891902 * the end of the link.
 1903+ * @return string
18901904 */
18911905 static function makeBrokenLink( $title, $text = '', $query = '', $trail = '' ) {
18921906 wfDeprecated( __METHOD__, '1.16' );
@@ -1914,6 +1928,7 @@
19151929 * be included in the link text. Other characters will be appended after
19161930 * the end of the link.
19171931 * @param $prefix String: optional prefix. As trail, only before instead of after.
 1932+ * @return string
19181933 */
19191934 static function makeLinkObj( $nt, $text = '', $query = '', $trail = '', $prefix = '' ) {
19201935 # wfDeprecated( __METHOD__, '1.16' ); // See r105985 and it's revert. Somewhere still used.
@@ -1983,6 +1998,7 @@
19841999 * be included in the link text. Other characters will be appended after
19852000 * the end of the link.
19862001 * @param $prefix String: Optional prefix
 2002+ * @return string
19872003 */
19882004 static function makeBrokenLinkObj( $title, $text = '', $query = '', $trail = '', $prefix = '' ) {
19892005 wfDeprecated( __METHOD__, '1.16' );
@@ -2014,6 +2030,7 @@
20152031 * be included in the link text. Other characters will be appended after
20162032 * the end of the link.
20172033 * @param $prefix String: Optional prefix
 2034+ * @return string
20182035 */
20192036 static function makeColouredLinkObj( $nt, $colour, $text = '', $query = '', $trail = '', $prefix = '' ) {
20202037 wfDeprecated( __METHOD__, '1.16' );
@@ -2028,6 +2045,7 @@
20292046
20302047 /**
20312048 * Returns the attributes for the tooltip and access key.
 2049+ * @return array
20322050 */
20332051 public static function tooltipAndAccesskeyAttribs( $name ) {
20342052 # @todo FIXME: If Sanitizer::expandAttributes() treated "false" as "output
@@ -2048,6 +2066,7 @@
20492067
20502068 /**
20512069 * Returns raw bits of HTML, use titleAttrib()
 2070+ * @return null|string
20522071 */
20532072 public static function tooltip( $name, $options = null ) {
20542073 # @todo FIXME: If Sanitizer::expandAttributes() treated "false" as "output
@@ -2074,6 +2093,7 @@
20752094 *
20762095 * @param $fname String Name of called method
20772096 * @param $args Array Arguments to the method
 2097+ * @return mixed
20782098 */
20792099 public function __call( $fname, $args ) {
20802100 return call_user_func_array( array( 'Linker', $fname ), $args );
Index: trunk/phase3/includes/profiler/Profiler.php
@@ -205,6 +205,7 @@
206206
207207 /**
208208 * Returns a tree of function call instead of a list of functions
 209+ * @return string
209210 */
210211 function getCallTree() {
211212 return implode( '', array_map( array( &$this, 'getCallTreeLine' ), $this->remapCallTree( $this->mStack ) ) );
@@ -214,6 +215,7 @@
215216 * Recursive function the format the current profiling array into a tree
216217 *
217218 * @param $stack array profiling array
 219+ * @return array
218220 */
219221 function remapCallTree( $stack ) {
220222 if( count( $stack ) < 2 ){
@@ -252,6 +254,7 @@
253255
254256 /**
255257 * Callback to get a formatted line for the call tree
 258+ * @return string
256259 */
257260 function getCallTreeLine( $entry ) {
258261 list( $fname, $level, $start, /* $x */, $end) = $entry;
@@ -494,6 +497,7 @@
495498
496499 /**
497500 * Get the function name of the current profiling section
 501+ * @return
498502 */
499503 function getCurrentSection() {
500504 $elt = end( $this->mWorkStack );
Index: trunk/phase3/includes/Init.php
@@ -197,6 +197,7 @@
198198 * @param $methodName string
199199 * @param $args array
200200 *
 201+ * @return mixed
201202 */
202203 static function callStaticMethod( $className, $methodName, $args ) {
203204 $r = new ReflectionMethod( $className, $methodName );
Index: trunk/phase3/includes/OutputPage.php
@@ -2788,6 +2788,7 @@
27892789
27902790 /**
27912791 * JS stuff to put at the bottom of the <body>
 2792+ * @return string
27922793 */
27932794 function getBottomScripts() {
27942795 global $wgResourceLoaderExperimentalAsyncLoading;
Index: trunk/phase3/includes/logging/LogPager.php
@@ -131,6 +131,7 @@
132132 * Set the log reader to return only entries by the given user.
133133 *
134134 * @param $name String: (In)valid user name
 135+ * @return bool
135136 */
136137 private function limitPerformer( $name ) {
137138 if( $name == '' ) {
@@ -166,6 +167,7 @@
167168 *
168169 * @param $page String or Title object: Title name
169170 * @param $pattern String
 171+ * @return bool
170172 */
171173 private function limitTitle( $page, $pattern ) {
172174 global $wgMiserMode;
Index: trunk/phase3/includes/logging/LogEntry.php
@@ -97,6 +97,7 @@
9898 /**
9999 * Whether the parameters for this log are stored in new or
100100 * old format.
 101+ * @return bool
101102 */
102103 public function isLegacy() {
103104 return false;
Index: trunk/phase3/includes/logging/LogFormatter.php
@@ -272,6 +272,7 @@
273273 * Provides the name of the user who performed the log action.
274274 * Used as part of log action message or standalone, depending
275275 * which parts of the log entry has been hidden.
 276+ * @return String
276277 */
277278 public function getPerformerElement() {
278279 if ( $this->canView( LogPage::DELETED_USER ) ) {
Index: trunk/phase3/includes/installer/WebInstaller.php
@@ -433,6 +433,7 @@
434434 *
435435 * @param $name String
436436 * @param $default
 437+ * @return null
437438 */
438439 public function getSession( $name, $default = null ) {
439440 if ( !isset( $this->session[$name] ) ) {
Index: trunk/phase3/includes/installer/PostgresUpdater.php
@@ -23,6 +23,7 @@
2424 /**
2525 * @todo FIXME: Postgres should use sequential updates like Mysql, Sqlite
2626 * and everybody else. It never got refactored like it should've.
 27+ * @return array
2728 */
2829 protected function getCoreUpdateList() {
2930 return array(
Index: trunk/phase3/includes/installer/Installer.php
@@ -672,6 +672,7 @@
673673
674674 /**
675675 * Some versions of libxml+PHP break < and > encoding horribly
 676+ * @return bool
676677 */
677678 protected function envCheckBrokenXML() {
678679 $test = new PhpXmlBugTester();
@@ -684,6 +685,7 @@
685686 /**
686687 * Test PHP (probably 5.3.1, but it could regress again) to make sure that
687688 * reference parameters to __call() are not converted to null
 689+ * @return bool
688690 */
689691 protected function envCheckPHP531() {
690692 $test = new PhpRefCallBugTester;
@@ -696,6 +698,7 @@
697699
698700 /**
699701 * Environment check for magic_quotes_runtime.
 702+ * @return bool
700703 */
701704 protected function envCheckMagicQuotes() {
702705 if( wfIniGetBool( "magic_quotes_runtime" ) ) {
@@ -706,6 +709,7 @@
707710
708711 /**
709712 * Environment check for magic_quotes_sybase.
 713+ * @return bool
710714 */
711715 protected function envCheckMagicSybase() {
712716 if ( wfIniGetBool( 'magic_quotes_sybase' ) ) {
@@ -716,6 +720,7 @@
717721
718722 /**
719723 * Environment check for mbstring.func_overload.
 724+ * @return bool
720725 */
721726 protected function envCheckMbstring() {
722727 if ( wfIniGetBool( 'mbstring.func_overload' ) ) {
@@ -726,6 +731,7 @@
727732
728733 /**
729734 * Environment check for zend.ze1_compatibility_mode.
 735+ * @return bool
730736 */
731737 protected function envCheckZE1() {
732738 if ( wfIniGetBool( 'zend.ze1_compatibility_mode' ) ) {
@@ -746,6 +752,7 @@
747753
748754 /**
749755 * Environment check for the XML module.
 756+ * @return bool
750757 */
751758 protected function envCheckXML() {
752759 if ( !function_exists( "utf8_encode" ) ) {
@@ -756,6 +763,7 @@
757764
758765 /**
759766 * Environment check for the PCRE module.
 767+ * @return bool
760768 */
761769 protected function envCheckPCRE() {
762770 if ( !function_exists( 'preg_match' ) ) {
@@ -773,6 +781,7 @@
774782
775783 /**
776784 * Environment check for available memory.
 785+ * @return bool
777786 */
778787 protected function envCheckMemory() {
779788 $limit = ini_get( 'memory_limit' );
@@ -846,6 +855,7 @@
847856
848857 /**
849858 * Environment check for ImageMagick and GD.
 859+ * @return bool
850860 */
851861 protected function envCheckGraphics() {
852862 $names = array( wfIsWindows() ? 'convert.exe' : 'convert' );
@@ -981,6 +991,7 @@
982992
983993 /**
984994 * TODO: document
 995+ * @return bool
985996 */
986997 protected function envCheckUploadsDirectory() {
987998 global $IP;
@@ -1121,6 +1132,7 @@
11221133 *
11231134 * If $versionInfo is not false, only executables with a version
11241135 * matching $versionInfo[1] will be returned.
 1136+ * @return bool|string
11251137 */
11261138 public static function locateExecutable( $path, $names, $versionInfo = false ) {
11271139 if ( !is_array( $names ) ) {
@@ -1169,6 +1181,7 @@
11701182 * Checks if scripts located in the given directory can be executed via the given URL.
11711183 *
11721184 * Used only by environment checks.
 1185+ * @return bool|int|string
11731186 */
11741187 public function dirIsExecutable( $dir, $url ) {
11751188 $scriptTypes = array(
Index: trunk/phase3/includes/installer/DatabaseInstaller.php
@@ -88,6 +88,7 @@
8989 * $this->parent can be assumed to be a WebInstaller.
9090 * If the DB type has no settings beyond those already configured with
9191 * getConnectForm(), this should return false.
 92+ * @return bool
9293 */
9394 public function getSettingsForm() {
9495 return false;
@@ -207,6 +208,7 @@
208209 /**
209210 * Override this to provide DBMS-specific schema variables, to be
210211 * substituted into tables.sql and other schema files.
 212+ * @return array
211213 */
212214 public function getSchemaVars() {
213215 return array();
@@ -282,6 +284,7 @@
283285
284286 /**
285287 * Get an array of MW configuration globals that will be configured by this class.
 288+ * @return array
286289 */
287290 public function getGlobalNames() {
288291 return $this->globalNames;
@@ -313,6 +316,7 @@
314317
315318 /**
316319 * Get the internationalised name for this DBMS.
 320+ * @return String
317321 */
318322 public function getReadableName() {
319323 return wfMsg( 'config-type-' . $this->getName() );
@@ -321,6 +325,7 @@
322326 /**
323327 * Get a name=>value map of MW configuration globals that overrides.
324328 * DefaultSettings.php
 329+ * @return array
325330 */
326331 public function getGlobalDefaults() {
327332 return array();
@@ -328,6 +333,7 @@
329334
330335 /**
331336 * Get a name=>value map of internal variables used during installation.
 337+ * @return array
332338 */
333339 public function getInternalDefaults() {
334340 return $this->internalDefaults;
@@ -439,6 +445,7 @@
440446 * values: List of allowed values (required)
441447 * itemAttribs Array of attribute arrays, outer key is the value name (optional)
442448 *
 449+ * @return string
443450 */
444451 public function getRadioSet( $params ) {
445452 $params['controlName'] = $this->getName() . '_' . $params['var'];
@@ -451,6 +458,7 @@
452459 * Assumes that variables containing "password" in the name are (potentially
453460 * fake) passwords.
454461 * @param $varNames Array
 462+ * @return array
455463 */
456464 public function setVarsFromRequest( $varNames ) {
457465 return $this->parent->setVarsFromRequest( $varNames, $this->getName() . '_' );
@@ -494,6 +502,7 @@
495503
496504 /**
497505 * Submit a standard install user fieldset.
 506+ * @return Status
498507 */
499508 public function submitInstallUserBox() {
500509 $this->setVarsFromRequest( array( '_InstallUser', '_InstallPassword' ) );
Index: trunk/phase3/includes/installer/OracleInstaller.php
@@ -241,6 +241,7 @@
242242
243243 /**
244244 * Overload: after this action field info table has to be rebuilt
 245+ * @return Status
245246 */
246247 public function createTables() {
247248 $this->setupSchemaVars();
Index: trunk/phase3/includes/installer/PostgresInstaller.php
@@ -344,6 +344,7 @@
345345 /**
346346 * Returns true if the install user is able to create objects owned
347347 * by the web user, false otherwise.
 348+ * @return bool
348349 */
349350 protected function canCreateObjectsForWebUser() {
350351 if ( $this->isSuperUser() ) {
Index: trunk/phase3/includes/installer/WebInstallerPage.php
@@ -36,6 +36,7 @@
3737 * Is this a slow-running page in the installer? If so, WebInstaller will
3838 * set_time_limit(0) before calling execute(). Right now this only applies
3939 * to Install and Upgrade pages
 40+ * @return bool
4041 */
4142 public function isSlow() {
4243 return false;
Index: trunk/phase3/includes/media/Exif.php
@@ -549,6 +549,7 @@
550550 */
551551 /**
552552 * Get $this->mRawExifData
 553+ * @return array
553554 */
554555 function getData() {
555556 return $this->mRawExifData;
Index: trunk/phase3/includes/media/SVGMetadataExtractor.php
@@ -99,6 +99,7 @@
100100
101101 /**
102102 * Read the SVG
 103+ * @return bool
103104 */
104105 public function read() {
105106 $keepReading = $this->reader->read();
Index: trunk/phase3/includes/media/MediaTransformOutput.php
@@ -80,6 +80,7 @@
8181
8282 /**
8383 * This will be overridden to return true in error classes
 84+ * @return bool
8485 */
8586 public function isError() {
8687 return false;
Index: trunk/phase3/includes/media/DjVu.php
@@ -191,6 +191,7 @@
192192 * Cache a document tree for the DjVu XML metadata
193193 * @param $image File
194194 * @param $gettext Boolean: DOCUMENT (Default: false)
 195+ * @return bool
195196 */
196197 function getMetaTree( $image , $gettext = false ) {
197198 if ( isset( $image->dejaMetaTree ) ) {
Index: trunk/phase3/includes/media/DjVuImage.php
@@ -284,6 +284,7 @@
285285
286286 /**
287287 * Hack to temporarily work around djvutoxml bug
 288+ * @return bool|string
288289 */
289290 function convertDumpToXML( $dump ) {
290291 if ( strval( $dump ) == '' ) {
Index: trunk/phase3/includes/media/Bitmap.php
@@ -572,6 +572,7 @@
573573 /**
574574 * Escape a string for ImageMagick's property input (e.g. -set -comment)
575575 * See InterpretImageProperties() in magick/property.c
 576+ * @return mixed|string
576577 */
577578 function escapeMagickProperty( $s ) {
578579 // Double the backslashes
@@ -599,6 +600,7 @@
600601 *
601602 * @param $path string The file path
602603 * @param $scene string The scene specification, or false if there is none
 604+ * @return string
603605 */
604606 function escapeMagickInput( $path, $scene = false ) {
605607 # Die on initial metacharacters (caller should prepend path)
@@ -616,6 +618,7 @@
617619 /**
618620 * Escape a string for ImageMagick's output filename. See
619621 * InterpretImageFilename() in magick/image.c.
 622+ * @return string
620623 */
621624 function escapeMagickOutput( $path, $scene = false ) {
622625 $path = str_replace( '%', '%%', $path );
@@ -628,6 +631,7 @@
629632 *
630633 * @param $path string The file path
631634 * @param $scene string The scene specification, or false if there is none
 635+ * @return string
632636 */
633637 protected function escapeMagickPath( $path, $scene = false ) {
634638 # Die on format specifiers (other than drive letters). The regex is
Index: trunk/phase3/includes/media/Generic.php
@@ -160,6 +160,7 @@
161161 * MediaHandler::METADATA_GOOD for if the metadata is a-ok,
162162 * MediaHanlder::METADATA_COMPATIBLE if metadata is old but backwards
163163 * compatible (which may or may not trigger a metadata reload).
 164+ * @return bool
164165 */
165166 function isMetadataValid( $image, $metadata ) {
166167 return self::METADATA_GOOD;
@@ -173,6 +174,7 @@
174175 * Used when the repository has a thumbnailScriptUrl option configured.
175176 *
176177 * Return false to fall back to the regular getTransform().
 178+ * @return bool
177179 */
178180 function getScriptedTransform( $image, $script, $params ) {
179181 return false;
@@ -186,6 +188,7 @@
187189 * @param $dstPath String: filesystem destination path
188190 * @param $dstUrl String: Destination URL to use in output HTML
189191 * @param $params Array: Arbitrary set of parameters validated by $this->validateParam()
 192+ * @return \MediaTransformOutput
190193 */
191194 final function getTransform( $image, $dstPath, $dstUrl, $params ) {
192195 return $this->doTransform( $image, $dstPath, $dstUrl, $params, self::TRANSFORM_LATER );
@@ -227,27 +230,33 @@
228231
229232 /**
230233 * True if the handled types can be transformed
 234+ * @return bool
231235 */
232236 function canRender( $file ) { return true; }
233237 /**
234238 * True if handled types cannot be displayed directly in a browser
235239 * but can be rendered
 240+ * @return bool
236241 */
237242 function mustRender( $file ) { return false; }
238243 /**
239244 * True if the type has multi-page capabilities
 245+ * @return bool
240246 */
241247 function isMultiPage( $file ) { return false; }
242248 /**
243249 * Page count for a multi-page document, false if unsupported or unknown
 250+ * @return bool
244251 */
245252 function pageCount( $file ) { return false; }
246253 /**
247254 * The material is vectorized and thus scaling is lossless
 255+ * @return bool
248256 */
249257 function isVectorized( $file ) { return false; }
250258 /**
251259 * False if the handler is disabled for all files
 260+ * @return bool
252261 */
253262 function isEnabled() { return true; }
254263
@@ -258,6 +267,7 @@
259268 * Returns false if unknown or if the document is not multi-page.
260269 *
261270 * @param $image File
 271+ * @return array
262272 */
263273 function getPageDimensions( $image, $page ) {
264274 $gis = $this->getImageSize( $image, $image->getLocalRefPath() );
@@ -270,6 +280,7 @@
271281 /**
272282 * Generic getter for text layer.
273283 * Currently overloaded by PDF and DjVu handlers
 284+ * @return bool
274285 */
275286 function getPageText( $image, $page ) {
276287 return false;
@@ -300,6 +311,7 @@
301312 * all the formatting according to some standard. That makes it possible
302313 * to do things like visual indication of grouped and chained streams
303314 * in ogg container files.
 315+ * @return bool
304316 */
305317 function formatMetadata( $image ) {
306318 return false;
Index: trunk/phase3/includes/PoolCounter.php
@@ -150,6 +150,7 @@
151151
152152 /**
153153 * Do something with the error, like showing it to the user.
 154+ * @return bool
154155 */
155156 function error( $status ) {
156157 return false;
Index: trunk/phase3/includes/Namespace.php
@@ -67,6 +67,7 @@
6868 /**
6969 * @see self::isSubject
7070 * @deprecated Please use the more consistently named isSubject (since 1.19)
 71+ * @return bool
7172 */
7273 public static function isMain( $index ) {
7374 wfDeprecated( __METHOD__, '1.19' );
Index: trunk/phase3/includes/normal/UtfNormalTest2.php
@@ -61,6 +61,7 @@
6262 * following functions to force pure PHP usage. I decided not to
6363 * commit that code since might produce a slowdown in the UTF
6464 * normalization code just for the sake of these tests. -- hexmode
 65+ * @return string
6566 */
6667 function normalize_form_c_php($c) { return UtfNormal::toNFC($c, "php"); }
6768 function normalize_form_d_php($c) { return UtfNormal::toNFD($c, "php"); }
Index: trunk/phase3/includes/normal/UtfNormal.php
@@ -238,6 +238,7 @@
239239 * Returns true if the string is _definitely_ in NFC.
240240 * Returns false if not or uncertain.
241241 * @param $string String: a UTF-8 string, altered on output to be valid UTF-8 safe for XML.
 242+ * @return bool
242243 */
243244 static function quickIsNFCVerify( &$string ) {
244245 # Screen out some characters that eg won't be allowed in XML
Index: trunk/phase3/includes/normal/UtfNormalTest.php
@@ -37,6 +37,7 @@
3838 } else {
3939 /**
4040 * @ignore
 41+ * @return string
4142 */
4243 function pretty( $string ) {
4344 return trim( preg_replace( '/(.)/use',

Status & tagging log