r69910 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r69909‎ | r69910 | r69911 >
Date:21:02, 25 July 2010
Author:reedy
Status:resolved (Comments)
Tags:
Comment:
Change some more to parent::
Modified paths:
  • /trunk/phase3/includes/RevisionDelete.php (modified) (history)
  • /trunk/phase3/includes/Skin.php (modified) (history)
  • /trunk/phase3/includes/SpecialPage.php (modified) (history)
  • /trunk/phase3/includes/media/Bitmap_ClientOnly.php (modified) (history)
  • /trunk/phase3/maintenance/installExtension.php (modified) (history)
  • /trunk/phase3/maintenance/language/StatOutputs.php (modified) (history)

Diff [purge]

Index: trunk/phase3/maintenance/language/StatOutputs.php
@@ -66,7 +66,7 @@
6767 $blue = '00';
6868 $color = $red . $green . $blue;
6969
70 - $percent = statsOutput::formatPercent( $subset, $total, $revert, $accuracy );
 70+ $percent = parent::formatPercent( $subset, $total, $revert, $accuracy );
7171 return 'bgcolor="#' . $color . '"|' . $percent;
7272 }
7373 }
Index: trunk/phase3/maintenance/installExtension.php
@@ -74,7 +74,7 @@
7575 class LocalInstallerRepository extends InstallerRepository {
7676
7777 function LocalInstallerRepository ( $path ) {
78 - InstallerRepository::InstallerRepository( $path );
 78+ parent::InstallerRepository( $path );
7979 }
8080
8181 function printListing( ) {
@@ -114,7 +114,7 @@
115115 class WebInstallerRepository extends InstallerRepository {
116116
117117 function WebInstallerRepository ( $path ) {
118 - InstallerRepository::InstallerRepository( $path );
 118+ parent::InstallerRepository( $path );
119119 }
120120
121121 function printListing( ) {
@@ -160,7 +160,7 @@
161161 class SVNInstallerRepository extends InstallerRepository {
162162
163163 function SVNInstallerRepository ( $path ) {
164 - InstallerRepository::InstallerRepository( $path );
 164+ parent::InstallerRepository( $path );
165165 }
166166
167167 function printListing( ) {
Index: trunk/phase3/includes/Skin.php
@@ -838,7 +838,7 @@
839839 $parenttree = $this->mTitle->getParentCategoryTree();
840840 # Skin object passed by reference cause it can not be
841841 # accessed under the method subfunction drawCategoryBrowser
842 - $tempout = explode( "\n", Skin::drawCategoryBrowser( $parenttree, $this ) );
 842+ $tempout = explode( "\n", $this->drawCategoryBrowser( $parenttree, $this ) );
843843 # Clean out bogus first entry and sort them
844844 unset( $tempout[0] );
845845 asort( $tempout );
@@ -863,7 +863,7 @@
864864 $return .= "\n";
865865 } else {
866866 # grab the others elements
867 - $return .= Skin::drawCategoryBrowser( $parent, $skin ) . ' > ';
 867+ $return .= $this->drawCategoryBrowser( $parent, $skin ) . ' > ';
868868 }
869869 # add our current element to the list
870870 $eltitle = Title::newFromText( $element );
Index: trunk/phase3/includes/RevisionDelete.php
@@ -938,7 +938,7 @@
939939 */
940940 class RevDel_ArchiveItem extends RevDel_RevisionItem {
941941 public function __construct( $list, $row ) {
942 - RevDel_Item::__construct( $list, $row );
 942+ parent::__construct( $list, $row );
943943 $this->revision = Revision::newFromArchiveRow( $row,
944944 array( 'page' => $this->list->title->getArticleId() ) );
945945 }
@@ -1246,7 +1246,7 @@
12471247 */
12481248 class RevDel_ArchivedFileItem extends RevDel_FileItem {
12491249 public function __construct( $list, $row ) {
1250 - RevDel_Item::__construct( $list, $row );
 1250+ parent::__construct( $list, $row );
12511251 $this->file = ArchivedFile::newFromRow( $row );
12521252 }
12531253
Index: trunk/phase3/includes/SpecialPage.php
@@ -915,7 +915,7 @@
916916 class UnlistedSpecialPage extends SpecialPage
917917 {
918918 function UnlistedSpecialPage( $name, $restriction = '', $function = false, $file = 'default' ) {
919 - SpecialPage::SpecialPage( $name, $restriction, false, $function, $file );
 919+ parent::SpecialPage( $name, $restriction, false, $function, $file );
920920 }
921921 }
922922
@@ -926,7 +926,7 @@
927927 class IncludableSpecialPage extends SpecialPage
928928 {
929929 function IncludableSpecialPage( $name, $restriction = '', $listed = true, $function = false, $file = 'default' ) {
930 - SpecialPage::SpecialPage( $name, $restriction, $listed, $function, $file, true );
 930+ parent::SpecialPage( $name, $restriction, $listed, $function, $file, true );
931931 }
932932 }
933933
Index: trunk/phase3/includes/media/Bitmap_ClientOnly.php
@@ -2,7 +2,7 @@
33
44 class BitmapHandler_ClientOnly extends BitmapHandler {
55 function normaliseParams( $image, &$params ) {
6 - return ImageHandler::normaliseParams( $image, $params );
 6+ return parent::normaliseParams( $image, $params );
77 }
88
99 function doTransform( $image, $dstPath, $dstUrl, $params, $flags = 0 ) {

Follow-up revisions

RevisionCommit summaryAuthorDate
r69967Revert r69841, r69882, r69892, r69896, r69910 in phase3/maintenance/language ...siebrand20:29, 26 July 2010
r78380Fix up few remaining fixme things from r69910reedy15:44, 14 December 2010

Comments

#Comment by Reedy (talk | contribs)   00:35, 21 November 2010

Reverted isn't right, it was only a partial reversion

#Comment by Catrope (talk | contribs)   12:27, 14 December 2010
-		SpecialPage::SpecialPage( $name, $restriction, false, $function, $file );
+		parent::SpecialPage( $name, $restriction, false, $function, $file );
[...]
-		InstallerRepository::InstallerRepository( $path );
+		parent::InstallerRepository( $path );

Just make those parent::__construct() while you're at it. Multiple occurrences of both.

-		return ImageHandler::normaliseParams( $image, $params );
+		return parent::normaliseParams( $image, $params );

parent == BitmapHandler != ImageHandler

-		RevDel_Item::__construct( $list, $row );
+		parent::__construct( $list, $row );

parent == RevDel_RevisionItem != RevDel_Item . Two occurrences.

#Comment by Reedy (talk | contribs)   12:49, 14 December 2010

installExtension was killed in r69916

Seems the other 2 can just be reverted then. Is calling higher parent constructors allowed?

#Comment by Catrope (talk | contribs)   15:32, 14 December 2010

I think it is. You may also want to investigate whether there's even a good reason to bypass the parent constructor and invoke the grandparent's directly.

#Comment by Reedy (talk | contribs)   15:45, 14 December 2010

Looks like chad has already tidied up the special page ones

r78380 does the rest

and bug 26333 against the grandparent constructor stuff

Status & tagging log