From f1bb5a385e7e6bdadb12c425288199e0dcc6fbe0 Mon Sep 17 00:00:00 2001 From: Brion Vibber Date: Wed, 2 May 2007 15:36:17 +0000 Subject: [PATCH] E_STRICT fixlets: properly mark some static methods as static Also removed a few obsolete object references --- includes/Image.php | 4 +--- includes/SquidUpdate.php | 10 +++++----- includes/WatchedItem.php | 15 +++++---------- 3 files changed, 11 insertions(+), 18 deletions(-) diff --git a/includes/Image.php b/includes/Image.php index 417d2a8cb4..274661aa4a 100644 --- a/includes/Image.php +++ b/includes/Image.php @@ -732,9 +732,8 @@ class Image * @param boolean $fromSharedDirectory Should this be in $wgSharedUploadPath? * @return string URL of $name image * @public - * @static */ - function imageUrl( $name, $fromSharedDirectory = false ) { + static function imageUrl( $name, $fromSharedDirectory = false ) { global $wgUploadPath,$wgUploadBaseUrl,$wgSharedUploadPath; if($fromSharedDirectory) { $base = ''; @@ -1210,7 +1209,6 @@ class Image /** * @return bool - * @static */ public static function isHashed( $shared ) { global $wgHashedUploadDirectory, $wgHashedSharedUploadDirectory; diff --git a/includes/SquidUpdate.php b/includes/SquidUpdate.php index 700fc8ef42..78cac6100d 100644 --- a/includes/SquidUpdate.php +++ b/includes/SquidUpdate.php @@ -22,7 +22,7 @@ class SquidUpdate { $this->urlArr = $urlArr; } - /* static */ function newFromLinksTo( &$title ) { + static function newFromLinksTo( &$title ) { $fname = 'SquidUpdate::newFromLinksTo'; wfProfileIn( $fname ); @@ -49,7 +49,7 @@ class SquidUpdate { return new SquidUpdate( $blurlArr ); } - /* static */ function newFromTitles( &$titles, $urlArr = array() ) { + static function newFromTitles( &$titles, $urlArr = array() ) { global $wgMaxSquidPurgeTitles; if ( count( $titles ) > $wgMaxSquidPurgeTitles ) { $titles = array_slice( $titles, 0, $wgMaxSquidPurgeTitles ); @@ -60,7 +60,7 @@ class SquidUpdate { return new SquidUpdate( $urlArr ); } - /* static */ function newSimplePurge( &$title ) { + static function newSimplePurge( &$title ) { $urlArr = $title->getSquidURLs(); return new SquidUpdate( $urlArr ); } @@ -74,7 +74,7 @@ class SquidUpdate { (example: $urlArr[] = 'http://my.host/something') XXX report broken Squids per mail or log */ - /* static */ function purge( $urlArr ) { + static function purge( $urlArr ) { global $wgSquidServers, $wgHTCPMulticastAddress, $wgHTCPPort; /*if ( (@$wgSquidServers[0]) == 'echo' ) { @@ -189,7 +189,7 @@ class SquidUpdate { wfProfileOut( $fname ); } - /* static */ function HTCPPurge( $urlArr ) { + static function HTCPPurge( $urlArr ) { global $wgHTCPMulticastAddress, $wgHTCPMulticastTTL, $wgHTCPPort; $fname = 'SquidUpdate::HTCPPurge'; wfProfileIn( $fname ); diff --git a/includes/WatchedItem.php b/includes/WatchedItem.php index b0376e3d1e..77b96427de 100644 --- a/includes/WatchedItem.php +++ b/includes/WatchedItem.php @@ -14,10 +14,10 @@ class WatchedItem { * @todo document * @access private */ - function &fromUserTitle( &$user, &$title ) { + static function fromUserTitle( $user, $title ) { $wl = new WatchedItem; - $wl->mUser =& $user; - $wl->mTitle =& $title; + $wl->mUser = $user; + $wl->mTitle = $title; $wl->id = $user->getId(); # Patch (also) for email notification on page changes T.Gries/M.Arndt 11.09.2004 # TG patch: here we do not consider pages and their talk pages equivalent - why should we ? @@ -116,18 +116,13 @@ class WatchedItem { * * @param Title $ot Page title to duplicate entries from, if present * @param Title $nt Page title to add watches on - * @static */ - function duplicateEntries( $ot, $nt ) { + static function duplicateEntries( $ot, $nt ) { WatchedItem::doDuplicateEntries( $ot->getSubjectPage(), $nt->getSubjectPage() ); WatchedItem::doDuplicateEntries( $ot->getTalkPage(), $nt->getTalkPage() ); } - /** - * @static - * @access private - */ - function doDuplicateEntries( $ot, $nt ) { + private static function doDuplicateEntries( $ot, $nt ) { $fname = "WatchedItem::duplicateEntries"; $oldnamespace = $ot->getNamespace(); $newnamespace = $nt->getNamespace(); -- 2.20.1