r83299 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r83298‎ | r83299 | r83300 >
Date:17:01, 5 March 2011
Author:reedy
Status:ok
Tags:
Comment:
Explicit variables, documentation, newlines, braces
Modified paths:
  • /trunk/phase3/includes/ImagePage.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/ImagePage.php
@@ -7,10 +7,17 @@
88 */
99 class ImagePage extends Article {
1010
11 - /* private */ var $img; // Image object
 11+ /**
 12+ * @var File
 13+ */
 14+ /* private */ var $img;
 15+ /**
 16+ * @var File
 17+ */
1218 /* private */ var $displayImg;
1319 /* private */ var $repo;
1420 /* private */ var $fileLoaded;
 21+
1522 var $mExtraDescription = false;
1623 var $dupes;
1724
@@ -168,6 +175,7 @@
169176 }
170177 return $this->mRedirectTarget = Title::makeTitle( NS_FILE, $to );
171178 }
 179+
172180 public function followRedirect() {
173181 $this->loadFile();
174182 if ( $this->img->isLocal() ) {
@@ -180,6 +188,7 @@
181189 }
182190 return Title::makeTitle( NS_FILE, $to );
183191 }
 192+
184193 public function isRedirect( $text = false ) {
185194 $this->loadFile();
186195 if ( $this->img->isLocal() )
@@ -225,7 +234,6 @@
226235 return $this->dupes = $dupes;
227236
228237 }
229 -
230238
231239 /**
232240 * Create the TOC
@@ -556,7 +564,9 @@
557565 protected function uploadLinksBox() {
558566 global $wgUser, $wgOut, $wgEnableUploads, $wgUseExternalEditor;
559567
560 - if ( !$wgEnableUploads ) { return; }
 568+ if ( !$wgEnableUploads ) {
 569+ return;
 570+ }
561571
562572 $this->loadFile();
563573 if ( !$this->img->isLocal() )
@@ -714,7 +724,9 @@
715725 $this->loadFile();
716726
717727 $dupes = $this->getDuplicates();
718 - if ( count( $dupes ) == 0 ) return;
 728+ if ( count( $dupes ) == 0 ) {
 729+ return;
 730+ }
719731
720732 $wgOut->addHTML( "<div id='mw-imagepage-section-duplicates'>\n" );
721733 $wgOut->addWikiMsg( 'duplicatesoffile',
@@ -805,7 +817,6 @@
806818 $wgOut->addWikiText( $description );
807819 }
808820
809 -
810821 /**
811822 * Callback for usort() to do link sorts by (namespace, title)
812823 * Function copied from Title::compare()
@@ -830,9 +841,32 @@
831842 */
832843 class ImageHistoryList {
833844
834 - protected $imagePage, $img, $skin, $title, $repo, $showThumb;
 845+ /**
 846+ * @var Title
 847+ */
 848+ protected $title;
 849+
 850+ /**
 851+ * @var File
 852+ */
 853+ protected $img;
 854+
 855+ /**
 856+ * @var ImagePage
 857+ */
 858+ protected $imagePage;
 859+
 860+ /**
 861+ * @var Skin
 862+ */
 863+ protected $skin;
 864+
 865+ protected $repo, $showThumb;
835866 protected $preventClickjacking = false;
836867
 868+ /**
 869+ * @param ImagePage $imagePage
 870+ */
837871 public function __construct( $imagePage ) {
838872 global $wgUser, $wgShowArchiveThumbnails;
839873 $this->skin = $wgUser->getSkin();
@@ -876,6 +910,11 @@
877911 return "</table>\n$navLinks\n</div>\n";
878912 }
879913
 914+ /**
 915+ * @param $iscur
 916+ * @param File $file
 917+ * @return string
 918+ */
880919 public function imageHistoryLine( $iscur, $file ) {
881920 global $wgUser, $wgLang;
882921
@@ -1020,6 +1059,10 @@
10211060 return "<tr{$classAttr}>{$row}</tr>\n";
10221061 }
10231062
 1063+ /**
 1064+ * @param File $file
 1065+ * @return string
 1066+ */
10241067 protected function getThumbForLine( $file ) {
10251068 global $wgLang;
10261069
@@ -1059,6 +1102,19 @@
10601103 class ImageHistoryPseudoPager extends ReverseChronologicalPager {
10611104 protected $preventClickjacking = false;
10621105
 1106+ /**
 1107+ * @var File
 1108+ */
 1109+ protected $mImg;
 1110+
 1111+ /**
 1112+ * @var Title
 1113+ */
 1114+ protected $mTitle;
 1115+
 1116+ /**
 1117+ * @param ImagePage $imagePage
 1118+ */
10631119 function __construct( $imagePage ) {
10641120 parent::__construct();
10651121 $this->mImagePage = $imagePage;

Status & tagging log