a round of static statements
authorAntoine Musso <hashar@users.mediawiki.org>
Thu, 11 May 2006 19:39:50 +0000 (19:39 +0000)
committerAntoine Musso <hashar@users.mediawiki.org>
Thu, 11 May 2006 19:39:50 +0000 (19:39 +0000)
includes/LoadBalancer.php
includes/MagicWord.php
includes/OutputPage.php
includes/Parser.php
includes/Sanitizer.php
includes/SpecialPage.php
includes/Title.php
includes/User.php

index 83c0299..7206b7b 100644 (file)
@@ -62,7 +62,7 @@ class LoadBalancer {
                $this->mAllowLag = false;
        }
 
-       function newFromParams( $servers, $failFunction = false, $waitTimeout = 10 )
+       static function newFromParams( $servers, $failFunction = false, $waitTimeout = 10 )
        {
                $lb = new LoadBalancer;
                $lb->initialise( $servers, $failFunction, $waitTimeout );
index 5a42a7a..cd654ce 100644 (file)
@@ -182,7 +182,7 @@ class MagicWord {
         * Factory: creates an object representing an ID
         * @static
         */
-       function &get( $id ) {
+       static function &get( $id ) {
                global $wgMagicWords;
 
                if ( !is_array( $wgMagicWords ) ) {
index cb918ac..3bacd96 100644 (file)
@@ -611,7 +611,7 @@ class OutputPage {
                print $outs;
        }
 
-       function setEncodings() {
+       static function setEncodings() {
                global $wgInputEncoding, $wgOutputEncoding;
                global $wgUser, $wgContLang;
 
index e07b236..0e38b91 100644 (file)
@@ -4253,7 +4253,7 @@ class ParserOptions
         * Get parser options
         * @static
         */
-       function newFromUser( &$user ) {
+       static function newFromUser( &$user ) {
                $popts = new ParserOptions;
                $popts->initialiseFromUser( $user );
                return $popts;
index 7845419..7d4551e 100644 (file)
@@ -634,7 +634,7 @@ class Sanitizer {
         * @param string $id
         * @return string
         */
-       function escapeId( $id ) {
+       static function escapeId( $id ) {
                static $replace = array(
                        '%3A' => ':',
                        '%' => '.'
@@ -750,6 +750,7 @@ class Sanitizer {
         * @param string $text
         * @return string
         * @private
+        * @todo FIXME called from parser.php so not that much private
         */
        function normalizeCharReferences( $text ) {
                return preg_replace_callback(
@@ -761,7 +762,7 @@ class Sanitizer {
         * @param string $matches
         * @return string
         */
-       function normalizeCharReferencesCallback( $matches ) {
+       static function normalizeCharReferencesCallback( $matches ) {
                $ret = null;
                if( $matches[1] != '' ) {
                        $ret = Sanitizer::normalizeEntity( $matches[1] );
@@ -787,7 +788,7 @@ class Sanitizer {
         * @param string $name
         * @return string
         */
-       function normalizeEntity( $name ) {
+       static function normalizeEntity( $name ) {
                global $wgHtmlEntities;
                if( isset( $wgHtmlEntities[$name] ) ) {
                        return "&$name;";
@@ -835,8 +836,9 @@ class Sanitizer {
         * @param string $text
         * @return string
         * @public
+        * @static
         */
-       function decodeCharReferences( $text ) {
+       public static function decodeCharReferences( $text ) {
                return preg_replace_callback(
                        MW_CHAR_REFS_REGEX,
                        array( 'Sanitizer', 'decodeCharReferencesCallback' ),
@@ -847,7 +849,7 @@ class Sanitizer {
         * @param string $matches
         * @return string
         */
-       function decodeCharReferencesCallback( $matches ) {
+       static function decodeCharReferencesCallback( $matches ) {
                if( $matches[1] != '' ) {
                        return Sanitizer::decodeEntity( $matches[1] );
                } elseif( $matches[2] != '' ) {
@@ -1084,7 +1086,7 @@ class Sanitizer {
         * @return string
         * @static
         */
-       function hackDocType() {
+       static function hackDocType() {
                global $wgHtmlEntities;
                $out = "<!DOCTYPE html [\n";
                foreach( $wgHtmlEntities as $entity => $codepoint ) {
index b061598..b88b6dc 100644 (file)
@@ -145,7 +145,7 @@ class SpecialPage
         * Use this for a special page extension
         * @static
         */
-       function addPage( &$obj ) {
+       static function addPage( &$obj ) {
                global $wgSpecialPages;
                $wgSpecialPages[$obj->mName] = $obj;
        }
@@ -155,7 +155,7 @@ class SpecialPage
         * Occasionally used to disable expensive or dangerous special pages
         * @static
         */
-       function removePage( $name ) {
+       static function removePage( $name ) {
                global $wgSpecialPages;
                unset( $wgSpecialPages[$name] );
        }
@@ -165,7 +165,7 @@ class SpecialPage
         * @static
         * @param string $name
         */
-       function getPage( $name ) {
+       static function getPage( $name ) {
                global $wgSpecialPages;
                if ( array_key_exists( $name, $wgSpecialPages ) ) {
                        return $wgSpecialPages[$name];
@@ -179,7 +179,7 @@ class SpecialPage
         * @param string $name
         * @return mixed Title object if the redirect exists, otherwise NULL
         */
-       function getRedirect( $name ) {
+       static function getRedirect( $name ) {
                global $wgUser;
 
                $redirects = array(
@@ -227,7 +227,7 @@ class SpecialPage
         * Returns a 2d array where the first index is the restriction name
         * @static
         */
-       function getPages() {
+       static function getPages() {
                global $wgSpecialPages;
                $pages = array(
                  '' => array(),
@@ -324,7 +324,7 @@ class SpecialPage
         * a redirect.
         * @static
         */
-       function capturePath( &$title ) {
+       static function capturePath( &$title ) {
                global $wgOut, $wgTitle;
 
                $oldTitle = $wgTitle;
index c23e0bf..ed841c5 100644 (file)
@@ -216,7 +216,7 @@ class Title {
         * @static
         * @access public
         */
-       function &makeTitle( $ns, $title ) {
+       public static function &makeTitle( $ns, $title ) {
                $t =& new Title();
                $t->mInterwiki = '';
                $t->mFragment = '';
index 5d6e2e8..81c45ec 100644 (file)
@@ -641,8 +641,9 @@ class User {
 
        /**
         * Initialise php session
+        * @static
         */
-       function SetupSession() {
+       static function SetupSession() {
                global $wgSessionsInMemcached, $wgCookiePath, $wgCookieDomain;
                if( $wgSessionsInMemcached ) {
                        require_once( 'MemcachedSessions.php' );
@@ -660,7 +661,7 @@ class User {
         * Create a new user object using data from session
         * @static
         */
-       function loadFromSession() {
+       static function loadFromSession() {
                global $wgMemc, $wgDBname, $wgCookiePrefix;
 
                if ( isset( $_SESSION['wsUserID'] ) ) {