* $magicWords = [];
*
* $magicWords['en'] = [
- * 'magicwordkey' => [ 0, 'case_insensitive_magic_word' ],
- * 'magicwordkey2' => [ 1, 'CASE_sensitive_magic_word2' ],
+ * 'magicwordkey' => [ 0, 'case_insensitive_magic_word' ],
+ * 'magicwordkey2' => [ 1, 'CASE_sensitive_magic_word2' ],
* ];
* @endcode
*
* Returns true if the text matches the word, and alters the
* input string, removing all instances of the word
*
- * @param string $text
+ * @param string &$text
*
* @return bool
*/
}
/**
- * @param string $text
+ * @param string &$text
* @return bool
*/
public function matchStartAndRemove( &$text ) {
*
* @param array $magicarr
* @param string $subject
- * @param string $result
+ * @param string &$result
*
* @return bool
*/
$search = [];
$replace = [];
foreach ( $magicarr as $id => $replacement ) {
- $mw = MagicWord::get( $id );
+ $mw = self::get( $id );
$search[] = $mw->getRegex();
$replace[] = $replacement;
}
* Adds all the synonyms of this MagicWord to an array, to allow quick
* lookup in a list of magic words
*
- * @param array $array
+ * @param array &$array
* @param string $value
*/
public function addToArray( &$array, $value ) {