fix some spacing
[lhc/web/wiklou.git] / includes / MagicWord.php
index 6d2e1dc..7b66924 100644 (file)
@@ -217,7 +217,7 @@ class MagicWord {
 
        /**#@-*/
 
-       function __construct($id = 0, $syn = array(), $cs = false) {
+       function __construct( $id = 0, $syn = array(), $cs = false ) {
                $this->mId = $id;
                $this->mSynonyms = (array)$syn;
                $this->mCaseSensitive = $cs;
@@ -282,6 +282,7 @@ class MagicWord {
         */
        static function getDoubleUnderscoreArray() {
                if ( is_null( self::$mDoubleUnderscoreArray ) ) {
+                       wfRunHooks( 'GetDoubleUnderscoreIDs', array( &self::$mDoubleUnderscoreIDs ) );
                        self::$mDoubleUnderscoreArray = new MagicWordArray( self::$mDoubleUnderscoreIDs );
                }
                return self::$mDoubleUnderscoreArray;
@@ -366,7 +367,7 @@ class MagicWord {
         * @return string
         */
        function getRegex() {
-               if ($this->mRegex == '' ) {
+               if ( $this->mRegex == '' ) {
                        $this->initRegex();
                }
                return $this->mRegex;
@@ -392,7 +393,7 @@ class MagicWord {
         * @return string
         */
        function getRegexStart() {
-               if ($this->mRegex == '' ) {
+               if ( $this->mRegex == '' ) {
                        $this->initRegex();
                }
                return $this->mRegexStart;
@@ -404,7 +405,7 @@ class MagicWord {
         * @return string
         */
        function getBaseRegex() {
-               if ($this->mRegex == '') {
+               if ( $this->mRegex == '' ) {
                        $this->initRegex();
                }
                return $this->mBaseRegex;
@@ -453,9 +454,9 @@ class MagicWord {
                        # blank elements and re-sort the indices.
                        # See also bug 6526
 
-                       $matches = array_values(array_filter($matches));
+                       $matches = array_values( array_filter( $matches ) );
 
-                       if ( count($matches) == 1 ) {
+                       if ( count( $matches ) == 1 ) {
                                return $matches[0];
                        } else {
                                return $matches[1];
@@ -463,7 +464,6 @@ class MagicWord {
                }
        }
 
-
        /**
         * Returns true if the text matches the word, and alters the
         * input string, removing all instances of the word
@@ -577,7 +577,7 @@ class MagicWord {
         *
         * @return bool
         */
-       function getWasModified(){
+       function getWasModified() {
                return $this->mModified;
        }
 
@@ -594,10 +594,10 @@ class MagicWord {
         *
         * @return bool
         */
-       function replaceMultiple( $magicarr, $subject, &$result ){
+       function replaceMultiple( $magicarr, $subject, &$result ) {
                $search = array();
                $replace = array();
-               foreach( $magicarr as $id => $replacement ){
+               foreach( $magicarr as $id => $replacement ) {
                        $mw = MagicWord::get( $id );
                        $search[] = $mw->getRegex();
                        $replace[] = $replacement;
@@ -617,7 +617,7 @@ class MagicWord {
        function addToArray( &$array, $value ) {
                global $wgContLang;
                foreach ( $this->mSynonyms as $syn ) {
-                       $array[$wgContLang->lc($syn)] = $value;
+                       $array[$wgContLang->lc( $syn )] = $value;
                }
        }
 
@@ -811,7 +811,7 @@ class MagicWordArray {
                        return array( $magicName, $paramValue );
                }
                // This shouldn't happen either
-               throw new MWException( __METHOD__.': parameter not found' );
+               throw new MWException( __METHOD__ . ': parameter not found' );
        }
 
        /**