usort( $synonyms, array( $this, 'compareStringLength' ) );
$escSyn = array();
- foreach ( $synonyms as $synonym )
+ foreach ( $synonyms as $synonym ) {
// In case a magic word contains /, like that's going to happen;)
$escSyn[] = preg_quote( $synonym, '/' );
+ }
$this->mBaseRegex = implode( '|', $escSyn );
$case = $this->mCaseSensitive ? '' : 'iu';
* @return string
*/
function getRegexCase() {
- if ( $this->mRegex === '' )
+ if ( $this->mRegex === '' ) {
$this->initRegex();
+ }
return $this->mCaseSensitive ? '' : 'iu';
}
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;