summaryrefslogtreecommitdiff
path: root/includes/MagicWord.php
diff options
context:
space:
mode:
Diffstat (limited to 'includes/MagicWord.php')
-rw-r--r--includes/MagicWord.php26
1 files changed, 13 insertions, 13 deletions
diff --git a/includes/MagicWord.php b/includes/MagicWord.php
index 42791f57..7b669249 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;
@@ -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
@@ -534,7 +534,7 @@ class MagicWord {
*
* @return string
*/
- function getVariableRegex() {
+ function getVariableRegex() {
if ( $this->mVariableRegex == '' ) {
$this->initRegex();
}
@@ -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' );
}
/**