r93250 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r93249‎ | r93250 | r93251 >
Date:21:32, 26 July 2011
Author:hashar
Status:ok (Comments)
Tags:
Comment:
Since r93249 SpecialPage::mName is explicitly private
use getName() accessor instead.
Modified paths:
  • /trunk/extensions/Deployment/specials/SpecialDashboard.php (modified) (history)
  • /trunk/extensions/Deployment/specials/SpecialExtensions.php (modified) (history)
  • /trunk/extensions/Deployment/specials/SpecialInstall.php (modified) (history)
  • /trunk/extensions/Deployment/specials/SpecialUpdate.php (modified) (history)
  • /trunk/extensions/LiveTranslate/specials/SpecialLiveTranslate.php (modified) (history)
  • /trunk/extensions/PureWikiDeletion/SpecialPureWikiDeletion.php (modified) (history)
  • /trunk/extensions/Push/specials/Push_Body.php (modified) (history)
  • /trunk/extensions/SemanticWatchlist/specials/SpecialSemanticWatchlist.php (modified) (history)
  • /trunk/extensions/SemanticWatchlist/specials/SpecialWatchlistConditions.php (modified) (history)
  • /trunk/extensions/UploadWizard/includes/specials/SpecialUploadCampaign.php (modified) (history)
  • /trunk/extensions/UploadWizard/includes/specials/SpecialUploadCampaigns.php (modified) (history)

Diff [purge]

Index: trunk/extensions/Deployment/specials/SpecialInstall.php
@@ -24,7 +24,7 @@
2525 * @see SpecialPage::getDescription
2626 */
2727 public function getDescription() {
28 - return wfMsg( 'special-' . strtolower( $this->mName ) );
 28+ return wfMsg( 'special-' . strtolower( $this->getName() ) );
2929 }
3030
3131 /**
Index: trunk/extensions/Deployment/specials/SpecialDashboard.php
@@ -24,7 +24,7 @@
2525 * @see SpecialPage::getDescription
2626 */
2727 public function getDescription() {
28 - return wfMsg( 'special-' . strtolower( $this->mName ) );
 28+ return wfMsg( 'special-' . strtolower( $this->getName() ) );
2929 }
3030
3131 /**
@@ -47,4 +47,4 @@
4848 }
4949 }
5050
51 -}
\ No newline at end of file
 51+}
Index: trunk/extensions/Deployment/specials/SpecialExtensions.php
@@ -39,7 +39,7 @@
4040 * @see SpecialPage::getDescription
4141 */
4242 public function getDescription() {
43 - return wfMsg( 'special-' . strtolower( $this->mName ) );
 43+ return wfMsg( 'special-' . strtolower( $this->getName() ) );
4444 }
4545
4646 /**
Index: trunk/extensions/Deployment/specials/SpecialUpdate.php
@@ -24,7 +24,7 @@
2525 * @see SpecialPage::getDescription
2626 */
2727 public function getDescription() {
28 - return wfMsg( 'special-' . strtolower( $this->mName ) );
 28+ return wfMsg( 'special-' . strtolower( $this->getName() ) );
2929 }
3030
3131 /**
Index: trunk/extensions/UploadWizard/includes/specials/SpecialUploadCampaign.php
@@ -33,7 +33,7 @@
3434 * @see SpecialPage::getDescription()
3535 */
3636 public function getDescription() {
37 - return wfMsg( 'mwe-upwiz-' . strtolower( $this->mName ) );
 37+ return wfMsg( 'mwe-upwiz-' . strtolower( $this->getName() ) );
3838 }
3939
4040 /**
@@ -117,4 +117,4 @@
118118 $this->getOutput()->redirect( SpecialPage::getTitleFor( 'UploadCampaigns' )->getLocalURL() );
119119 }
120120
121 -}
\ No newline at end of file
 121+}
Index: trunk/extensions/UploadWizard/includes/specials/SpecialUploadCampaigns.php
@@ -31,7 +31,7 @@
3232 * @see SpecialPage::getDescription()
3333 */
3434 public function getDescription() {
35 - return wfMsg( 'mwe-upwiz-' . strtolower( $this->mName ) );
 35+ return wfMsg( 'mwe-upwiz-' . strtolower( $this->getName() ) );
3636 }
3737
3838 /**
Index: trunk/extensions/SemanticWatchlist/specials/SpecialSemanticWatchlist.php
@@ -37,7 +37,7 @@
3838 * @since 0.1
3939 */
4040 public function getDescription() {
41 - return wfMsg( 'special-' . strtolower( $this->mName ) );
 41+ return wfMsg( 'special-' . strtolower( $this->getName() ) );
4242 }
4343
4444 /**
Index: trunk/extensions/SemanticWatchlist/specials/SpecialWatchlistConditions.php
@@ -28,7 +28,7 @@
2929 * @since 0.1
3030 */
3131 public function getDescription() {
32 - return wfMsg( 'special-' . strtolower( $this->mName ) );
 32+ return wfMsg( 'special-' . strtolower( $this->getName() ) );
3333 }
3434
3535 /**
Index: trunk/extensions/Push/specials/Push_Body.php
@@ -26,7 +26,7 @@
2727 * @see SpecialPage::getDescription
2828 */
2929 public function getDescription() {
30 - return wfMsg( 'special-' . strtolower( $this->mName ) );
 30+ return wfMsg( 'special-' . strtolower( $this->getName() ) );
3131 }
3232
3333 /**
@@ -340,4 +340,4 @@
341341 }
342342 }
343343
344 -}
\ No newline at end of file
 344+}
Index: trunk/extensions/PureWikiDeletion/SpecialPureWikiDeletion.php
@@ -46,7 +46,7 @@
4747
4848 if( is_null( $title ) ) {
4949 $this->setHeaders();
50 - $wgOut->addWikiMsg( strtolower( $this->mName ) . '-nopages', $wgContLang->getNsText( $this->namespace ) );
 50+ $wgOut->addWikiMsg( strtolower( $this->getName() ) . '-nopages', $wgContLang->getNsText( $this->namespace ) );
5151 return;
5252 }
5353
@@ -121,4 +121,4 @@
122122 $output = wfMsg( 'purewikideletion-population-done' );
123123 $wgOut->addWikiText($output);
124124 }
125 -}
\ No newline at end of file
 125+}
Index: trunk/extensions/LiveTranslate/specials/SpecialLiveTranslate.php
@@ -28,7 +28,7 @@
2929 * @since 0.4
3030 */
3131 public function getDescription() {
32 - return wfMsg( 'special-' . strtolower( $this->mName ) );
 32+ return wfMsg( 'special-' . strtolower( $this->getName() ) );
3333 }
3434
3535 /**

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r93249makes SpecialPage::mName explicitly private...hashar21:30, 26 July 2011

Comments

#Comment by Aaron Schulz (talk | contribs)   22:13, 1 August 2011

It is protected now. Should this be reverted?

#Comment by 😂 (talk | contribs)   18:24, 5 August 2011

Won't hurt either way. Accessors are always nicer though :)

#Comment by Aaron Schulz (talk | contribs)   18:34, 5 August 2011

I don't know about always.

#Comment by Hashar (talk | contribs)   21:01, 5 August 2011

I would prefer sticking to accessor. I like inserting a call to wfDebug() in them. There might a performance penalty though.

Status & tagging log