r21799 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r21798‎ | r21799 | r21800 >
Date:15:36, 2 May 2007
Author:brion
Status:old (Comments)
Tags:
Comment:
E_STRICT fixlets: properly mark some static methods as static
Also removed a few obsolete object references
Modified paths:
  • /trunk/phase3/includes/Image.php (modified) (history)
  • /trunk/phase3/includes/SquidUpdate.php (modified) (history)
  • /trunk/phase3/includes/WatchedItem.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/WatchedItem.php
@@ -14,10 +14,10 @@
1515 * @todo document
1616 * @access private
1717 */
18 - function &fromUserTitle( &$user, &$title ) {
 18+ static function fromUserTitle( $user, $title ) {
1919 $wl = new WatchedItem;
20 - $wl->mUser =& $user;
21 - $wl->mTitle =& $title;
 20+ $wl->mUser = $user;
 21+ $wl->mTitle = $title;
2222 $wl->id = $user->getId();
2323 # Patch (also) for email notification on page changes T.Gries/M.Arndt 11.09.2004
2424 # TG patch: here we do not consider pages and their talk pages equivalent - why should we ?
@@ -116,18 +116,13 @@
117117 *
118118 * @param Title $ot Page title to duplicate entries from, if present
119119 * @param Title $nt Page title to add watches on
120 - * @static
121120 */
122 - function duplicateEntries( $ot, $nt ) {
 121+ static function duplicateEntries( $ot, $nt ) {
123122 WatchedItem::doDuplicateEntries( $ot->getSubjectPage(), $nt->getSubjectPage() );
124123 WatchedItem::doDuplicateEntries( $ot->getTalkPage(), $nt->getTalkPage() );
125124 }
126125
127 - /**
128 - * @static
129 - * @access private
130 - */
131 - function doDuplicateEntries( $ot, $nt ) {
 126+ private static function doDuplicateEntries( $ot, $nt ) {
132127 $fname = "WatchedItem::duplicateEntries";
133128 $oldnamespace = $ot->getNamespace();
134129 $newnamespace = $nt->getNamespace();
Index: trunk/phase3/includes/Image.php
@@ -732,9 +732,8 @@
733733 * @param boolean $fromSharedDirectory Should this be in $wgSharedUploadPath?
734734 * @return string URL of $name image
735735 * @public
736 - * @static
737736 */
738 - function imageUrl( $name, $fromSharedDirectory = false ) {
 737+ static function imageUrl( $name, $fromSharedDirectory = false ) {
739738 global $wgUploadPath,$wgUploadBaseUrl,$wgSharedUploadPath;
740739 if($fromSharedDirectory) {
741740 $base = '';
@@ -1210,7 +1209,6 @@
12111210
12121211 /**
12131212 * @return bool
1214 - * @static
12151213 */
12161214 public static function isHashed( $shared ) {
12171215 global $wgHashedUploadDirectory, $wgHashedSharedUploadDirectory;
Index: trunk/phase3/includes/SquidUpdate.php
@@ -22,7 +22,7 @@
2323 $this->urlArr = $urlArr;
2424 }
2525
26 - /* static */ function newFromLinksTo( &$title ) {
 26+ static function newFromLinksTo( &$title ) {
2727 $fname = 'SquidUpdate::newFromLinksTo';
2828 wfProfileIn( $fname );
2929
@@ -49,7 +49,7 @@
5050 return new SquidUpdate( $blurlArr );
5151 }
5252
53 - /* static */ function newFromTitles( &$titles, $urlArr = array() ) {
 53+ static function newFromTitles( &$titles, $urlArr = array() ) {
5454 global $wgMaxSquidPurgeTitles;
5555 if ( count( $titles ) > $wgMaxSquidPurgeTitles ) {
5656 $titles = array_slice( $titles, 0, $wgMaxSquidPurgeTitles );
@@ -60,7 +60,7 @@
6161 return new SquidUpdate( $urlArr );
6262 }
6363
64 - /* static */ function newSimplePurge( &$title ) {
 64+ static function newSimplePurge( &$title ) {
6565 $urlArr = $title->getSquidURLs();
6666 return new SquidUpdate( $urlArr );
6767 }
@@ -74,7 +74,7 @@
7575 (example: $urlArr[] = 'http://my.host/something')
7676 XXX report broken Squids per mail or log */
7777
78 - /* static */ function purge( $urlArr ) {
 78+ static function purge( $urlArr ) {
7979 global $wgSquidServers, $wgHTCPMulticastAddress, $wgHTCPPort;
8080
8181 /*if ( (@$wgSquidServers[0]) == 'echo' ) {
@@ -189,7 +189,7 @@
190190 wfProfileOut( $fname );
191191 }
192192
193 - /* static */ function HTCPPurge( $urlArr ) {
 193+ static function HTCPPurge( $urlArr ) {
194194 global $wgHTCPMulticastAddress, $wgHTCPMulticastTTL, $wgHTCPPort;
195195 $fname = 'SquidUpdate::HTCPPurge';
196196 wfProfileIn( $fname );

Follow-up revisions

RevisionCommit summaryAuthorDate
r69969Follow up r21799. Fix usage of $this in static method.platonides20:51, 26 July 2010

Comments

#Comment by Reedy (talk | contribs)   20:09, 23 July 2010

r4318 added/changed on Line 41 (in newFromLinksTo)

if ( $dbr->numRows( $res ) <= $this->mMaxTitles ) {

This method marked it the method as static

Status & tagging log