r101242 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r101241‎ | r101242 | r101243 >
Date:01:53, 29 October 2011
Author:reedy
Status:ok (Comments)
Tags:
Comment:
More documentation
Modified paths:
  • /trunk/phase3/includes/Article.php (modified) (history)
  • /trunk/phase3/includes/CategoryViewer.php (modified) (history)
  • /trunk/phase3/includes/Cdb_PHP.php (modified) (history)
  • /trunk/phase3/includes/FileDeleteForm.php (modified) (history)
  • /trunk/phase3/includes/HttpFunctions.php (modified) (history)
  • /trunk/phase3/includes/ImagePage.php (modified) (history)
  • /trunk/phase3/includes/Import.php (modified) (history)
  • /trunk/phase3/includes/LinksUpdate.php (modified) (history)
  • /trunk/phase3/includes/cache/CacheDependency.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/Article.php
@@ -33,7 +33,6 @@
3434 protected $mPage;
3535
3636 /**
37 - * @protected
3837 * @var ParserOptions: ParserOptions object for $wgUser articles
3938 */
4039 public $mParserOptions;
@@ -1091,6 +1090,10 @@
10921091 }
10931092
10941093 // the loop prepends the arrow image before the link, so the first case needs to be outside
 1094+
 1095+ /**
 1096+ * @var $title Title
 1097+ */
10951098 $title = array_shift( $target );
10961099
10971100 if ( $forceKnown ) {
@@ -1521,6 +1524,8 @@
15221525
15231526 /**
15241527 * Perform a deletion and output success or failure messages
 1528+ * @param $reason
 1529+ * @param $suppress bool
15251530 */
15261531 public function doDelete( $reason, $suppress = false ) {
15271532 global $wgOut;
@@ -2044,21 +2049,21 @@
20452050 * @param $title Title
20462051 */
20472052 public static function onArticleCreate( $title ) {
2048 - return WikiPage::onArticleCreate( $title );
 2053+ WikiPage::onArticleCreate( $title );
20492054 }
20502055
20512056 /**
20522057 * @param $title Title
20532058 */
20542059 public static function onArticleDelete( $title ) {
2055 - return WikiPage::onArticleDelete( $title );
 2060+ WikiPage::onArticleDelete( $title );
20562061 }
20572062
20582063 /**
20592064 * @param $title Title
20602065 */
20612066 public static function onArticleEdit( $title ) {
2062 - return WikiPage::onArticleEdit( $title );
 2067+ WikiPage::onArticleEdit( $title );
20632068 }
20642069
20652070 /**
@@ -2087,10 +2092,16 @@
20882093 $this->parserOptions = $parserOptions;
20892094 }
20902095
 2096+ /**
 2097+ * @return bool
 2098+ */
20912099 function doWork() {
20922100 return $this->mArticle->doViewParse();
20932101 }
20942102
 2103+ /**
 2104+ * @return bool
 2105+ */
20952106 function getCachedWork() {
20962107 global $wgOut;
20972108
@@ -2108,6 +2119,9 @@
21092120 return false;
21102121 }
21112122
 2123+ /**
 2124+ * @return bool
 2125+ */
21122126 function fallback() {
21132127 return $this->mArticle->tryDirtyCache();
21142128 }
Index: trunk/phase3/includes/ImagePage.php
@@ -188,6 +188,9 @@
189189 $wgOut->addModuleStyles( 'filepage' );
190190 }
191191
 192+ /**
 193+ * @return File
 194+ */
192195 public function getDisplayedFile() {
193196 $this->loadFile();
194197 return $this->displayImg;
@@ -247,6 +250,7 @@
248251 *
249252 * Omit noarticletext if sharedupload; text will be fetched from the
250253 * shared upload server if possible.
 254+ * @return string
251255 */
252256 public function getContent() {
253257 $this->loadFile();
@@ -398,7 +402,7 @@
399403 'action' => $wgScript,
400404 'onchange' => 'document.pageselector.submit();',
401405 );
402 -
 406+ $options = array();
403407 for ( $i = 1; $i <= $count; $i++ ) {
404408 $options[] = Xml::option( $wgLang->formatNum( $i ), $i, $i == $page );
405409 }
@@ -484,9 +488,10 @@
485489
486490 /**
487491 * Creates an thumbnail of specified size and returns an HTML link to it
488 - * @param array $params Scaler parameters
489 - * @param int $width
490 - * @param int $height
 492+ * @param $params array Scaler parameters
 493+ * @param $width int
 494+ * @param $height int
 495+ * @return string
491496 */
492497 private function makeSizeLink( $params, $width, $height ) {
493498 $params['width'] = $width;
@@ -615,6 +620,11 @@
616621 }
617622 }
618623
 624+ /**
 625+ * @param $target
 626+ * @param $limit
 627+ * @return ResultWrapper
 628+ */
619629 protected function queryImageLinks( $target, $limit ) {
620630 $dbr = wfGetDB( DB_SLAVE );
621631
@@ -747,6 +757,9 @@
748758 );
749759 $wgOut->addHTML( "<ul class='mw-imagepage-duplicates'>\n" );
750760
 761+ /**
 762+ * @var $file File
 763+ */
751764 foreach ( $dupes as $file ) {
752765 $fromSrc = '';
753766 if ( $file->isLocal() ) {
@@ -841,6 +854,11 @@
842855 */
843856 protected $imagePage;
844857
 858+ /**
 859+ * @var File
 860+ */
 861+ protected $current;
 862+
845863 protected $repo, $showThumb;
846864 protected $preventClickjacking = false;
847865
@@ -856,14 +874,24 @@
857875 $this->showThumb = $wgShowArchiveThumbnails && $this->img->canRender();
858876 }
859877
 878+ /**
 879+ * @return ImagePage
 880+ */
860881 public function getImagePage() {
861882 return $this->imagePage;
862883 }
863884
 885+ /**
 886+ * @return File
 887+ */
864888 public function getFile() {
865889 return $this->img;
866890 }
867891
 892+ /**
 893+ * @param $navLinks string
 894+ * @return string
 895+ */
868896 public function beginImageHistoryList( $navLinks = '' ) {
869897 global $wgOut, $wgUser;
870898 return Xml::element( 'h2', array( 'id' => 'filehistory' ), wfMsg( 'filehist' ) ) . "\n"
@@ -881,6 +909,10 @@
882910 . "</tr>\n";
883911 }
884912
 913+ /**
 914+ * @param $navLinks string
 915+ * @return string
 916+ */
885917 public function endImageHistoryList( $navLinks = '' ) {
886918 return "</table>\n$navLinks\n</div>\n";
887919 }
@@ -1071,10 +1103,16 @@
10721104 }
10731105 }
10741106
 1107+ /**
 1108+ * @param $enable bool
 1109+ */
10751110 protected function preventClickjacking( $enable = true ) {
10761111 $this->preventClickjacking = $enable;
10771112 }
10781113
 1114+ /**
 1115+ * @return bool
 1116+ */
10791117 public function getPreventClickjacking() {
10801118 return $this->preventClickjacking;
10811119 }
@@ -1106,6 +1144,9 @@
11071145 $this->mRange = array( 0, 0 ); // display range
11081146 }
11091147
 1148+ /**
 1149+ * @return Title
 1150+ */
11101151 function getTitle() {
11111152 return $this->mTitle;
11121153 }
@@ -1114,14 +1155,23 @@
11151156 return false;
11161157 }
11171158
 1159+ /**
 1160+ * @return string
 1161+ */
11181162 function getIndexField() {
11191163 return '';
11201164 }
11211165
 1166+ /**
 1167+ * @return string
 1168+ */
11221169 function formatRow( $row ) {
11231170 return '';
11241171 }
11251172
 1173+ /**
 1174+ * @return string
 1175+ */
11261176 function getBody() {
11271177 $s = '';
11281178 $this->doQuery();
@@ -1225,10 +1275,16 @@
12261276 $this->mQueryDone = true;
12271277 }
12281278
 1279+ /**
 1280+ * @param $enable bool
 1281+ */
12291282 protected function preventClickjacking( $enable = true ) {
12301283 $this->preventClickjacking = $enable;
12311284 }
12321285
 1286+ /**
 1287+ * @return bool
 1288+ */
12331289 public function getPreventClickjacking() {
12341290 return $this->preventClickjacking;
12351291 }
Index: trunk/phase3/includes/CategoryViewer.php
@@ -133,6 +133,9 @@
134134
135135 /**
136136 * Add a subcategory to the internal lists, using a Category object
 137+ * @param $cat Category
 138+ * @param $sortkey
 139+ * @param $pageLength
137140 */
138141 function addSubcategoryObject( Category $cat, $sortkey, $pageLength ) {
139142 // Subcategory; strip the 'Category' namespace from the link text.
@@ -185,6 +188,10 @@
186189
187190 /**
188191 * Add a page in the image namespace
 192+ * @param $title Title
 193+ * @param $sortkey
 194+ * @param $pageLength
 195+ * @param $isRedirect bool
189196 */
190197 function addImage( Title $title, $sortkey, $pageLength, $isRedirect = false ) {
191198 global $wgContLang;
@@ -211,6 +218,10 @@
212219
213220 /**
214221 * Add a miscellaneous page
 222+ * @param $title
 223+ * @param $sortkey
 224+ * @param $pageLength
 225+ * @param $isRedirect bool
215226 */
216227 function addPage( $title, $sortkey, $pageLength, $isRedirect = false ) {
217228 global $wgContLang;
@@ -316,6 +327,9 @@
317328 }
318329 }
319330
 331+ /**
 332+ * @return string
 333+ */
320334 function getCategoryTop() {
321335 $r = $this->getCategoryBottom();
322336 return $r === ''
@@ -323,6 +337,9 @@
324338 : "<br style=\"clear:both;\"/>\n" . $r;
325339 }
326340
 341+ /**
 342+ * @return string
 343+ */
327344 function getSubcategorySection() {
328345 # Don't show subcategories section if there are none.
329346 $r = '';
@@ -343,6 +360,9 @@
344361 return $r;
345362 }
346363
 364+ /**
 365+ * @return string
 366+ */
347367 function getPagesSection() {
348368 $ti = htmlspecialchars( $this->title->getText() );
349369 # Don't show articles section if there are none.
@@ -369,6 +389,9 @@
370390 return $r;
371391 }
372392
 393+ /**
 394+ * @return string
 395+ */
373396 function getImageSection() {
374397 $r = '';
375398 $rescnt = $this->showGallery ? $this->gallery->count() : count( $this->imgsNoGallery );
@@ -408,6 +431,9 @@
409432 }
410433 }
411434
 435+ /**
 436+ * @return string
 437+ */
412438 function getCategoryBottom() {
413439 return '';
414440 }
@@ -567,6 +593,7 @@
568594 *
569595 * @param Title $title: The title (usually $this->title)
570596 * @param String $section: Which section
 597+ * @return Title
571598 */
572599 private function addFragmentToTitle( $title, $section ) {
573600 switch ( $section ) {
Index: trunk/phase3/includes/Cdb_PHP.php
@@ -1,6 +1,6 @@
22 <?php
33 /**
4 - * This is a port of D.J. Bernstein's CDB to PHP. It's based on the copy that
 4+ * This is a port of D.J. Bernstein's CDB to PHP. It's based on the copy that
55 * appears in PHP 5.3. Changes are:
66 * * Error returns replaced with exceptions
77 * * Exception thrown if sizes or offsets are between 2GB and 4GB
@@ -50,7 +50,7 @@
5151
5252 /**
5353 * The CDB hash function.
54 - *
 54+ *
5555 * @param $s
5656 *
5757 * @return
@@ -62,7 +62,7 @@
6363 // Do a 32-bit sum
6464 // Inlined here for speed
6565 $sum = ($h & 0x3fffffff) + ($h5 & 0x3fffffff);
66 - $h =
 66+ $h =
6767 (
6868 ( $sum & 0x40000000 ? 1 : 0 )
6969 + ( $h & 0x80000000 ? 2 : 0 )
@@ -104,8 +104,11 @@
105105 var $dpos;
106106
107107 /* initialized if cdb_findnext() returns 1 */
108 - var $dlen;
 108+ var $dlen;
109109
 110+ /**
 111+ * @param $fileName string
 112+ */
110113 function __construct( $fileName ) {
111114 $this->handle = fopen( $fileName, 'rb' );
112115 if ( !$this->handle ) {
@@ -257,8 +260,11 @@
258261 var $handle, $realFileName, $tmpFileName;
259262
260263 var $hplist;
261 - var $numEntries, $pos;
 264+ var $numentries, $pos;
262265
 266+ /**
 267+ * @param $fileName string
 268+ */
263269 function __construct( $fileName ) {
264270 $this->realFileName = $fileName;
265271 $this->tmpFileName = $fileName . '.tmp.' . mt_rand( 0, 0x7fffffff );
@@ -391,7 +397,7 @@
392398 }
393399
394400 // Excessively clever and indulgent code to simultaneously fill $packedTables
395 - // with the packed hashtables, and adjust the elements of $starts
 401+ // with the packed hashtables, and adjust the elements of $starts
396402 // to actually point to the starts instead of the ends.
397403 $packedTables = array_fill( 0, $this->numentries, false );
398404 foreach ( $this->hplist as $item ) {
@@ -416,7 +422,7 @@
417423 // is taken.
418424 for ( $u = 0; $u < $count; ++$u ) {
419425 $hp = $packedTables[$starts[$i] + $u];
420 - $where = CdbFunctions::unsignedMod(
 426+ $where = CdbFunctions::unsignedMod(
421427 CdbFunctions::unsignedShiftRight( $hp['h'], 8 ), $len );
422428 while ( $hashtable[$where]['p'] )
423429 if ( ++$where == $len )
@@ -426,7 +432,7 @@
427433
428434 // Write the hashtable
429435 for ( $u = 0; $u < $len; ++$u ) {
430 - $buf = pack( 'vvV',
 436+ $buf = pack( 'vvV',
431437 $hashtable[$u]['h'] & 0xffff,
432438 CdbFunctions::unsignedShiftRight( $hashtable[$u]['h'], 16 ),
433439 $hashtable[$u]['p'] );
Index: trunk/phase3/includes/LinksUpdate.php
@@ -297,14 +297,17 @@
298298 );
299299 }
300300
 301+ /**
 302+ * @param $cats
 303+ */
301304 function invalidateCategories( $cats ) {
302305 $this->invalidatePages( NS_CATEGORY, array_keys( $cats ) );
303306 }
304307
305308 /**
306309 * Update all the appropriate counts in the category table.
307 - * @param $added associative array of category name => sort key
308 - * @param $deleted associative array of category name => sort key
 310+ * @param $added array associative array of category name => sort key
 311+ * @param $deleted array associative array of category name => sort key
309312 */
310313 function updateCategoryCounts( $added, $deleted ) {
311314 $a = new Article($this->mTitle);
@@ -313,10 +316,18 @@
314317 );
315318 }
316319
 320+ /**
 321+ * @param $images
 322+ */
317323 function invalidateImageDescriptions( $images ) {
318324 $this->invalidatePages( NS_FILE, array_keys( $images ) );
319325 }
320326
 327+ /**
 328+ * @param $table
 329+ * @param $insertions
 330+ * @param $fromField
 331+ */
321332 function dumbTableUpdate( $table, $insertions, $fromField ) {
322333 $this->mDb->delete( $table, array( $fromField => $this->mId ), __METHOD__ );
323334 if ( count( $insertions ) ) {
@@ -329,7 +340,10 @@
330341
331342 /**
332343 * Update a table by doing a delete query then an insert query
333 - *
 344+ * @param $table
 345+ * @param $prefix
 346+ * @param $deletions
 347+ * @param $insertions
334348 */
335349 function incrTableUpdate( $table, $prefix, $deletions, $insertions ) {
336350 if ( $table == 'page_props' ) {
@@ -372,11 +386,11 @@
373387 }
374388 }
375389
376 -
377390 /**
378391 * Get an array of pagelinks insertions for passing to the DB
379392 * Skips the titles specified by the 2-D array $existing
380 - *
 393+ * @param $existing array
 394+ * @return array
381395 */
382396 function getLinkInsertions( $existing = array() ) {
383397 $arr = array();
@@ -397,7 +411,8 @@
398412
399413 /**
400414 * Get an array of template insertions. Like getLinkInsertions()
401 - *
 415+ * @param $existing array
 416+ * @return array
402417 */
403418 function getTemplateInsertions( $existing = array() ) {
404419 $arr = array();
@@ -417,6 +432,8 @@
418433 /**
419434 * Get an array of image insertions
420435 * Skips the names specified in $existing
 436+ * @param $existing array
 437+ * @return array
421438 */
422439 function getImageInsertions( $existing = array() ) {
423440 $arr = array();
@@ -432,6 +449,8 @@
433450
434451 /**
435452 * Get an array of externallinks insertions. Skips the names specified in $existing
 453+ * @param $existing array
 454+ * @return array
436455 */
437456 function getExternalInsertions( $existing = array() ) {
438457 $arr = array();
@@ -449,8 +468,10 @@
450469 /**
451470 * Get an array of category insertions
452471 *
453 - * @param $existing Array mapping existing category names to sort keys. If both
 472+ * @param $existing array mapping existing category names to sort keys. If both
454473 * match a link in $this, the link will be omitted from the output
 474+ *
 475+ * @return array
455476 */
456477 function getCategoryInsertions( $existing = array() ) {
457478 global $wgContLang, $wgCategoryCollation;
@@ -493,6 +514,7 @@
494515 *
495516 * @param $existing Array mapping existing language codes to titles
496517 *
 518+ * @return array
497519 */
498520 function getInterlangInsertions( $existing = array() ) {
499521 $diffs = array_diff_assoc( $this->mInterlangs, $existing );
@@ -509,6 +531,8 @@
510532
511533 /**
512534 * Get an array of page property insertions
 535+ * @param $existing array
 536+ * @return array
513537 */
514538 function getPropertyInsertions( $existing = array() ) {
515539 $diffs = array_diff_assoc( $this->mProperties, $existing );
@@ -526,7 +550,8 @@
527551 /**
528552 * Get an array of interwiki insertions for passing to the DB
529553 * Skips the titles specified by the 2-D array $existing
530 - *
 554+ * @param $existing array
 555+ * @return array
531556 */
532557 function getInterwikiInsertions( $existing = array() ) {
533558 $arr = array();
@@ -546,7 +571,8 @@
547572 /**
548573 * Given an array of existing links, returns those links which are not in $this
549574 * and thus should be deleted.
550 - *
 575+ * @param $existing array
 576+ * @return array
551577 */
552578 function getLinkDeletions( $existing ) {
553579 $del = array();
@@ -563,7 +589,8 @@
564590 /**
565591 * Given an array of existing templates, returns those templates which are not in $this
566592 * and thus should be deleted.
567 - *
 593+ * @param $existing array
 594+ * @return array
568595 */
569596 function getTemplateDeletions( $existing ) {
570597 $del = array();
@@ -580,7 +607,8 @@
581608 /**
582609 * Given an array of existing images, returns those images which are not in $this
583610 * and thus should be deleted.
584 - *
 611+ * @param $existing array
 612+ * @return array
585613 */
586614 function getImageDeletions( $existing ) {
587615 return array_diff_key( $existing, $this->mImages );
@@ -589,7 +617,8 @@
590618 /**
591619 * Given an array of existing external links, returns those links which are not
592620 * in $this and thus should be deleted.
593 - *
 621+ * @param $existing array
 622+ * @return array
594623 */
595624 function getExternalDeletions( $existing ) {
596625 return array_diff_key( $existing, $this->mExternals );
@@ -598,7 +627,8 @@
599628 /**
600629 * Given an array of existing categories, returns those categories which are not in $this
601630 * and thus should be deleted.
602 - *
 631+ * @param $existing array
 632+ * @return array
603633 */
604634 function getCategoryDeletions( $existing ) {
605635 return array_diff_assoc( $existing, $this->mCategories );
@@ -607,7 +637,8 @@
608638 /**
609639 * Given an array of existing interlanguage links, returns those links which are not
610640 * in $this and thus should be deleted.
611 - *
 641+ * @param $existing array
 642+ * @return array
612643 */
613644 function getInterlangDeletions( $existing ) {
614645 return array_diff_assoc( $existing, $this->mInterlangs );
@@ -615,7 +646,8 @@
616647
617648 /**
618649 * Get array of properties which should be deleted.
619 - *
 650+ * @param $existing array
 651+ * @return array
620652 */
621653 function getPropertyDeletions( $existing ) {
622654 return array_diff_assoc( $existing, $this->mProperties );
@@ -624,7 +656,8 @@
625657 /**
626658 * Given an array of existing interwiki links, returns those links which are not in $this
627659 * and thus should be deleted.
628 - *
 660+ * @param $existing array
 661+ * @return array
629662 */
630663 function getInterwikiDeletions( $existing ) {
631664 $del = array();
@@ -641,6 +674,7 @@
642675 /**
643676 * Get an array of existing links, as a 2-D array
644677 *
 678+ * @return array
645679 */
646680 function getExistingLinks() {
647681 $res = $this->mDb->select( 'pagelinks', array( 'pl_namespace', 'pl_title' ),
@@ -658,6 +692,7 @@
659693 /**
660694 * Get an array of existing templates, as a 2-D array
661695 *
 696+ * @return array
662697 */
663698 function getExistingTemplates() {
664699 $res = $this->mDb->select( 'templatelinks', array( 'tl_namespace', 'tl_title' ),
@@ -675,6 +710,7 @@
676711 /**
677712 * Get an array of existing images, image names in the keys
678713 *
 714+ * @return array
679715 */
680716 function getExistingImages() {
681717 $res = $this->mDb->select( 'imagelinks', array( 'il_to' ),
@@ -689,6 +725,7 @@
690726 /**
691727 * Get an array of existing external links, URLs in the keys
692728 *
 729+ * @return array
693730 */
694731 function getExistingExternals() {
695732 $res = $this->mDb->select( 'externallinks', array( 'el_to' ),
@@ -703,6 +740,7 @@
704741 /**
705742 * Get an array of existing categories, with the name in the key and sort key in the value.
706743 *
 744+ * @return array
707745 */
708746 function getExistingCategories() {
709747 $res = $this->mDb->select( 'categorylinks', array( 'cl_to', 'cl_sortkey_prefix' ),
@@ -718,6 +756,7 @@
719757 * Get an array of existing interlanguage links, with the language code in the key and the
720758 * title in the value.
721759 *
 760+ * @return array
722761 */
723762 function getExistingInterlangs() {
724763 $res = $this->mDb->select( 'langlinks', array( 'll_lang', 'll_title' ),
@@ -749,6 +788,7 @@
750789 /**
751790 * Get an array of existing categories, with the name in the key and sort key in the value.
752791 *
 792+ * @return array
753793 */
754794 function getExistingProperties() {
755795 $res = $this->mDb->select( 'page_props', array( 'pp_propname', 'pp_value' ),
@@ -760,9 +800,9 @@
761801 return $arr;
762802 }
763803
764 -
765804 /**
766805 * Return the title object of the page being updated
 806+ * @return Title
767807 */
768808 function getTitle() {
769809 return $this->mTitle;
@@ -770,6 +810,7 @@
771811
772812 /**
773813 * Return the list of images used as generated by the parser
 814+ * @return array
774815 */
775816 public function getImages() {
776817 return $this->mImages;
@@ -777,6 +818,7 @@
778819
779820 /**
780821 * Invalidate any necessary link lists related to page property changes
 822+ * @param $changed
781823 */
782824 function invalidateProperties( $changed ) {
783825 global $wgPagePropLinkInvalidations;
Index: trunk/phase3/includes/cache/CacheDependency.php
@@ -28,6 +28,8 @@
2929
3030 /**
3131 * Returns true if any of the dependencies have expired
 32+ *
 33+ * @return bool
3234 */
3335 function isExpired() {
3436 foreach ( $this->deps as $dep ) {
@@ -51,6 +53,7 @@
5254
5355 /**
5456 * Get the user-defined value
 57+ * @return bool|\Mixed
5558 */
5659 function getValue() {
5760 return $this->value;
@@ -143,6 +146,9 @@
144147 $this->timestamp = $timestamp;
145148 }
146149
 150+ /**
 151+ * @return array
 152+ */
147153 function __sleep() {
148154 $this->loadDependencyValues();
149155 return array( 'filename', 'timestamp' );
@@ -265,11 +271,15 @@
266272
267273 /**
268274 * Construct a dependency on a list of titles
 275+ * @param $linkBatch LinkBatch
269276 */
270277 function __construct( LinkBatch $linkBatch ) {
271278 $this->linkBatch = $linkBatch;
272279 }
273280
 281+ /**
 282+ * @return array
 283+ */
274284 function calculateTimestamps() {
275285 # Initialise values to false
276286 $timestamps = array();
@@ -314,6 +324,9 @@
315325 return array( 'timestamps' );
316326 }
317327
 328+ /**
 329+ * @return LinkBatch
 330+ */
318331 function getLinkBatch() {
319332 if ( !isset( $this->linkBatch ) ) {
320333 $this->linkBatch = new LinkBatch;
Index: trunk/phase3/includes/FileDeleteForm.php
@@ -8,12 +8,23 @@
99 */
1010 class FileDeleteForm {
1111
 12+ /**
 13+ * @var Title
 14+ */
1215 private $title = null;
 16+
 17+ /**
 18+ * @var File
 19+ */
1320 private $file = null;
1421
 22+ /**
 23+ * @var File
 24+ */
1525 private $oldfile = null;
1626 private $oldimage = '';
1727
 28+ private $DeleteReason, $DeleteReasonList;
1829 /**
1930 * Constructor
2031 *
@@ -295,6 +306,9 @@
296307 * value was provided, does it correspond to an
297308 * existing, local, old version of this file?
298309 *
 310+ * @param $file File
 311+ * @param $oldfile File
 312+ * @param $oldimage File
299313 * @return bool
300314 */
301315 public static function haveDeletableFile(&$file, &$oldfile, $oldimage) {
Index: trunk/phase3/includes/HttpFunctions.php
@@ -53,6 +53,9 @@
5454 * Simple wrapper for Http::request( 'GET' )
5555 * @see Http::request()
5656 *
 57+ * @param $url
 58+ * @param $timeout string
 59+ * @param $options array
5760 * @return string
5861 */
5962 public static function get( $url, $timeout = 'default', $options = array() ) {
@@ -64,6 +67,8 @@
6568 * Simple wrapper for Http::request( 'POST' )
6669 * @see Http::request()
6770 *
 71+ * @param $url
 72+ * @param $options array
6873 * @return string
6974 */
7075 public static function post( $url, $options = array() ) {
@@ -221,6 +226,7 @@
222227 * Generate a new request object
223228 * @param $url String: url to use
224229 * @param $options Array: (optional) extra params to pass (see Http::request())
 230+ * @return \CurlHttpRequest|\PhpHttpRequest
225231 * @see MWHttpRequest::__construct
226232 */
227233 public static function factory( $url, $options = null ) {
@@ -295,6 +301,7 @@
296302
297303 /**
298304 * Set the user agent
 305+ * @param $UA string
299306 */
300307 public function setUserAgent( $UA ) {
301308 $this->setHeader( 'User-Agent', $UA );
@@ -302,6 +309,8 @@
303310
304311 /**
305312 * Set an arbitrary header
 313+ * @param $name
 314+ * @param $value
306315 */
307316 public function setHeader( $name, $value ) {
308317 // I feel like I should normalize the case here...
@@ -310,6 +319,7 @@
311320
312321 /**
313322 * Get an array of the headers
 323+ * @return array
314324 */
315325 public function getHeaderList() {
316326 $list = array();
@@ -540,6 +550,9 @@
541551 * cookies. Used internally after a request to parse the
542552 * Set-Cookie headers.
543553 * @see Cookie::set
 554+ * @param $name
 555+ * @param $value null
 556+ * @param $attr null
544557 */
545558 public function setCookie( $name, $value = null, $attr = null ) {
546559 if ( !$this->cookieJar ) {
@@ -614,6 +627,7 @@
615628 /**
616629 * Returns true if the backend can follow redirects. Overridden by the
617630 * child classes.
 631+ * @return bool
618632 */
619633 public function canFollowRedirects() {
620634 return true;
@@ -634,6 +648,11 @@
635649 protected $curlOptions = array();
636650 protected $headerText = "";
637651
 652+ /**
 653+ * @param $fh
 654+ * @param $content
 655+ * @return int
 656+ */
638657 protected function readHeader( $fh, $content ) {
639658 $this->headerText .= $content;
640659 return strlen( $content );
@@ -725,6 +744,9 @@
726745 return $this->status;
727746 }
728747
 748+ /**
 749+ * @return bool
 750+ */
729751 public function canFollowRedirects() {
730752 if ( strval( ini_get( 'open_basedir' ) ) !== '' || wfIniGetBool( 'safe_mode' ) ) {
731753 wfDebug( "Cannot follow redirects in safe mode\n" );
@@ -741,6 +763,11 @@
742764 }
743765
744766 class PhpHttpRequest extends MWHttpRequest {
 767+
 768+ /**
 769+ * @param $url string
 770+ * @return string
 771+ */
745772 protected function urlToTcp( $url ) {
746773 $parsedUrl = parse_url( $url );
747774
Index: trunk/phase3/includes/Import.php
@@ -40,6 +40,7 @@
4141
4242 /**
4343 * Creates an ImportXMLReader drawing from the source provided
 44+ * @param $source
4445 */
4546 function __construct( $source ) {
4647 $this->reader = new XMLReader();
@@ -48,8 +49,7 @@
4950 $id = UploadSourceAdapter::registerSource( $source );
5051 if (defined( 'LIBXML_PARSEHUGE' ) ) {
5152 $this->reader->open( "uploadsource://$id", null, LIBXML_PARSEHUGE );
52 - }
53 - else {
 53+ } else {
5454 $this->reader->open( "uploadsource://$id" );
5555 }
5656
@@ -87,6 +87,7 @@
8888
8989 /**
9090 * Set debug mode...
 91+ * @param $debug bool
9192 */
9293 function setDebug( $debug ) {
9394 $this->mDebug = $debug;
@@ -94,6 +95,7 @@
9596
9697 /**
9798 * Set 'no updates' mode. In this mode, the link tables will not be updated by the importer
 99+ * @param $noupdates bool
98100 */
99101 function setNoUpdates( $noupdates ) {
100102 $this->mNoUpdates = $noupdates;
@@ -171,6 +173,8 @@
172174
173175 /**
174176 * Set a target namespace to override the defaults
 177+ * @param $namespace
 178+ * @return bool
175179 */
176180 public function setTargetNamespace( $namespace ) {
177181 if( is_null( $namespace ) ) {
@@ -185,7 +189,7 @@
186190 }
187191
188192 /**
189 - * @parma $dir
 193+ * @param $dir
190194 */
191195 public function setImageBasePath( $dir ) {
192196 $this->mImageBasePath = $dir;
@@ -201,6 +205,7 @@
202206 /**
203207 * Default per-revision callback, performs the import.
204208 * @param $revision WikiRevision
 209+ * @return bool
205210 */
206211 public function importRevision( $revision ) {
207212 $dbw = wfGetDB( DB_MASTER );
@@ -210,6 +215,7 @@
211216 /**
212217 * Default per-revision callback, performs the import.
213218 * @param $rev WikiRevision
 219+ * @return bool
214220 */
215221 public function importLogItem( $rev ) {
216222 $dbw = wfGetDB( DB_MASTER );
@@ -218,6 +224,8 @@
219225
220226 /**
221227 * Dummy for now...
 228+ * @param $revision
 229+ * @return bool
222230 */
223231 public function importUpload( $revision ) {
224232 $dbw = wfGetDB( DB_MASTER );
@@ -226,6 +234,12 @@
227235
228236 /**
229237 * Mostly for hook use
 238+ * @param $title
 239+ * @param $origTitle
 240+ * @param $revCount
 241+ * @param $sRevCount
 242+ * @param $pageInfo
 243+ * @return
230244 */
231245 public function finishImportPage( $title, $origTitle, $revCount, $sRevCount, $pageInfo ) {
232246 $args = func_get_args();
@@ -930,6 +944,10 @@
931945 */
932946 class WikiRevision {
933947 var $importer = null;
 948+
 949+ /**
 950+ * @var Title
 951+ */
934952 var $title = null;
935953 var $id = 0;
936954 var $timestamp = "20010115000000";
@@ -945,6 +963,7 @@
946964 var $sha1base36 = false;
947965 var $isTemp = false;
948966 var $archiveName = '';
 967+ var $fileIsTemp;
949968 private $mNoUpdates = false;
950969
951970 /**
@@ -1062,6 +1081,9 @@
10631082 $this->type = $type;
10641083 }
10651084
 1085+ /**
 1086+ * @param $action
 1087+ */
10661088 function setAction( $action ) {
10671089 $this->action = $action;
10681090 }
@@ -1428,10 +1450,16 @@
14291451 $this->mRead = false;
14301452 }
14311453
 1454+ /**
 1455+ * @return bool
 1456+ */
14321457 function atEnd() {
14331458 return $this->mRead;
14341459 }
14351460
 1461+ /**
 1462+ * @return bool|string
 1463+ */
14361464 function readChunk() {
14371465 if( $this->atEnd() ) {
14381466 return false;
@@ -1457,6 +1485,9 @@
14581486 return feof( $this->mHandle );
14591487 }
14601488
 1489+ /**
 1490+ * @return string
 1491+ */
14611492 function readChunk() {
14621493 return fread( $this->mHandle, 32768 );
14631494 }

Comments

#Comment by Johnduhart (talk | contribs)   01:55, 29 October 2011
-		return WikiPage::onArticleEdit( $title );
+		WikiPage::onArticleEdit( $title );

Nothing useful is ever returned right?
#Comment by Reedy (talk | contribs)   04:46, 29 October 2011

Exactly, well, nothing AT ALL is returned!

Status & tagging log