X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2FMagicWord.php;h=7b66924904c9779ca754fbe7191af1a9cc44478b;hb=d63121016d894e3fccf3308a26704472e69ec08f;hp=7cf59e9597bce5b7a25e3acb6927011bfdbe349c;hpb=3c994ff08a0be045bbef3a54f3a18bc98cb7ef5f;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/MagicWord.php b/includes/MagicWord.php index 7cf59e9597..7b66924904 100644 --- a/includes/MagicWord.php +++ b/includes/MagicWord.php @@ -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; @@ -367,7 +367,7 @@ class MagicWord { * @return string */ function getRegex() { - if ($this->mRegex == '' ) { + if ( $this->mRegex == '' ) { $this->initRegex(); } return $this->mRegex; @@ -393,7 +393,7 @@ class MagicWord { * @return string */ function getRegexStart() { - if ($this->mRegex == '' ) { + if ( $this->mRegex == '' ) { $this->initRegex(); } return $this->mRegexStart; @@ -405,7 +405,7 @@ class MagicWord { * @return string */ function getBaseRegex() { - if ($this->mRegex == '') { + if ( $this->mRegex == '' ) { $this->initRegex(); } return $this->mBaseRegex; @@ -454,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]; @@ -464,7 +464,6 @@ class MagicWord { } } - /** * Returns true if the text matches the word, and alters the * input string, removing all instances of the word @@ -598,7 +597,7 @@ class MagicWord { 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; @@ -618,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; } } @@ -812,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' ); } /**