class ProfanityPregCallback in Profanity 7
Hierarchy
- class \ProfanityPregCallback
Expanded class hierarchy of ProfanityPregCallback
File
- ./
profanity.module, line 584 - Main {profanity} file.
View source
class ProfanityPregCallback {
private $wordlist;
private $modifiers;
private $character;
private $count = 0;
public function __construct($wordlist, $modifiers, $character) {
$this->wordlist = $wordlist;
$this->modifiers = $modifiers;
$this->character = $character;
}
public function execute($text) {
return preg_replace_callback("/\\b(" . $this->wordlist . ")\\b" . $this->modifiers, array(
$this,
'match_replace',
), $text, -1);
}
public function match_replace($matches) {
$this->count = $this->count + 1;
return str_repeat($this->character, strlen(utf8_decode($matches[0])));
}
public function get_count() {
return $this->count;
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
ProfanityPregCallback:: |
private | property | ||
ProfanityPregCallback:: |
private | property | ||
ProfanityPregCallback:: |
private | property | ||
ProfanityPregCallback:: |
private | property | ||
ProfanityPregCallback:: |
public | function | ||
ProfanityPregCallback:: |
public | function | ||
ProfanityPregCallback:: |
public | function | ||
ProfanityPregCallback:: |
public | function |