r39610 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r39609‎ | r39610 | r39611 >
Date:20:27, 18 August 2008
Author:aaron
Status:old
Tags:
Comment:
mark static functions
Modified paths:
  • /trunk/phase3/includes/parser/Parser.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/parser/Parser.php
@@ -504,7 +504,7 @@
505505 * @public
506506 * @static
507507 */
508 - function extractTagsAndParams($elements, $text, &$matches, $uniq_prefix = ''){
 508+ static function extractTagsAndParams($elements, $text, &$matches, $uniq_prefix = ''){
509509 static $n = 1;
510510 $stripped = '';
511511 $matches = array();
@@ -644,7 +644,7 @@
645645 * @public
646646 * @static
647647 */
648 - function tidy( $text ) {
 648+ static function tidy( $text ) {
649649 global $wgTidyInternal;
650650 $wrappedtext = '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"'.
651651 ' "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html>'.
@@ -667,7 +667,7 @@
668668 * @private
669669 * @static
670670 */
671 - function externalTidy( $text ) {
 671+ static function externalTidy( $text ) {
672672 global $wgTidyConf, $wgTidyBin, $wgTidyOpts;
673673 wfProfileIn( __METHOD__ );
674674
@@ -718,7 +718,7 @@
719719 * @private
720720 * @static
721721 */
722 - function internalTidy( $text ) {
 722+ static function internalTidy( $text ) {
723723 global $wgTidyConf, $IP, $wgDebugTidy;
724724 wfProfileIn( __METHOD__ );
725725
@@ -1054,7 +1054,7 @@
10551055 *
10561056 * @private
10571057 */
1058 - function doHeadings( $text ) {
 1058+ static function doHeadings( $text ) {
10591059 wfProfileIn( __METHOD__ );
10601060 for ( $i = 6; $i >= 1; --$i ) {
10611061 $h = str_repeat( '=', $i );
@@ -1070,12 +1070,12 @@
10711071 * @private
10721072 * @return string the altered text
10731073 */
1074 - function doAllQuotes( $text ) {
 1074+ static function doAllQuotes( $text ) {
10751075 wfProfileIn( __METHOD__ );
10761076 $outtext = '';
10771077 $lines = StringUtils::explode( "\n", $text );
10781078 foreach ( $lines as $line ) {
1079 - $outtext .= $this->doQuotes( $line ) . "\n";
 1079+ $outtext .= self::doQuotes( $line ) . "\n";
10801080 }
10811081 $outtext = substr($outtext, 0,-1);
10821082 wfProfileOut( __METHOD__ );
@@ -1085,7 +1085,7 @@
10861086 /**
10871087 * Helper function for doAllQuotes()
10881088 */
1089 - public function doQuotes( $text ) {
 1089+ public static function doQuotes( $text ) {
10901090 $arr = preg_split( "/(''+)/", $text, -1, PREG_SPLIT_DELIM_CAPTURE );
10911091 if ( count( $arr ) == 1 )
10921092 return $text;
@@ -1955,7 +1955,7 @@
19561956 # getCommon() returns the length of the longest common substring
19571957 # of both arguments, starting at the beginning of both.
19581958 #
1959 - /* private */ function getCommon( $st1, $st2 ) {
 1959+ /* private */ static function getCommon( $st1, $st2 ) {
19601960 $fl = strlen( $st1 );
19611961 $shorter = strlen( $st2 );
19621962 if ( $fl < $shorter ) { $shorter = $fl; }
@@ -2194,7 +2194,7 @@
21952195 * @param string &$after set to everything after the ':'
21962196 * return string the position of the ':', or false if none found
21972197 */
2198 - function findColonNoLinks($str, &$before, &$after) {
 2198+ static function findColonNoLinks($str, &$before, &$after) {
21992199 wfProfileIn( __METHOD__ );
22002200
22012201 $pos = strpos( $str, ':' );
@@ -3143,7 +3143,7 @@
31443144 return $this->fetchScaryTemplateMaybeFromCache($url);
31453145 }
31463146
3147 - function fetchScaryTemplateMaybeFromCache($url) {
 3147+ static function fetchScaryTemplateMaybeFromCache($url) {
31483148 global $wgTranscludeCacheExpiry;
31493149 $dbr = wfGetDB(DB_SLAVE);
31503150 $obj = $dbr->selectRow('transcache', array('tc_time', 'tc_contents'),
@@ -3798,7 +3798,7 @@
37993799 * @param string $text
38003800 * @return mixed An expanded string, or false if invalid.
38013801 */
3802 - function validateSig( $text ) {
 3802+ static function validateSig( $text ) {
38033803 return( wfIsWellFormedXmlFragment( $text ) ? $text : false );
38043804 }
38053805
@@ -3850,7 +3850,7 @@
38513851 * @param string $text
38523852 * @return string Signature text with /~{3,5}/ removed
38533853 */
3854 - function cleanSigInSig( $text ) {
 3854+ static function cleanSigInSig( $text ) {
38553855 $text = preg_replace( '/~{3,5}/', '', $text );
38563856 return $text;
38573857 }
@@ -4042,7 +4042,7 @@
40434043 /**
40444044 * Tag hook handler for 'pre'.
40454045 */
4046 - function renderPreTag( $text, $attribs ) {
 4046+ static function renderPreTag( $text, $attribs ) {
40474047 // Backwards-compatibility hack
40484048 $content = StringUtils::delimiterReplace( '<nowiki>', '</nowiki>', '$1', $text, 'i' );
40494049

Status & tagging log