vB_Utility_Censor
in package
Uses
vB_Utility_Trait_NoSerialize
Table of Contents
Methods
- __construct() : mixed
- Constructor
- __serialize() : array<string|int, mixed>
- __sleep() : array<string|int, mixed>
- __unserialize() : void
- __wakeup() : void
- match() : mixed
- replace() : string
- Replaces any instances of words censored in the censor text with replacechar
Methods
__construct()
Constructor
public
__construct(mixed $stringUtil, mixed $censortext) : mixed
Parameters
- $stringUtil : mixed
- $censortext : mixed
__serialize()
public
__serialize() : array<string|int, mixed>
Return values
array<string|int, mixed>__sleep()
public
__sleep() : array<string|int, mixed>
Return values
array<string|int, mixed>__unserialize()
public
__unserialize(mixed $serialized) : void
Parameters
- $serialized : mixed
__wakeup()
public
__wakeup() : void
match()
public
match(mixed $text) : mixed
Parameters
- $text : mixed
replace()
Replaces any instances of words censored in the censor text with replacechar
public
replace(string $text, string $replacechar) : string
Parameters
- $text : string
- $replacechar : string
-
-- the string to replace each character of a censored word with generally assumed to be a single character but there isn't any dependency on that (and I don't think the option that we generally use explicitly requires a single character). You can pass an empty string to strip the censored word instead of replacing it.