Configurator
class Configurator extends ConfiguratorBase implements ArrayAccess, Countable, Iterator
Traits
Allows an object to act as a proxy for a NormalizedCollection stored in $this->collection
Properties
protected Configurator | $configurator | from ConfiguratorBase | |
protected mixed | $quickMatch | from ConfiguratorBase | |
protected int | $regexpLimit | from ConfiguratorBase | |
protected NormalizedCollection | $collection | ||
protected array | $allowed | ||
protected string | $attrName | ||
protected string | $defaultReplacement | ||
protected array | $regexpOptions | ||
protected string | $tagName |
Methods
Plugin's setup
No description
Return a list of base properties meant to be added to asConfig()'s return
Return additional hints used in the JavaScript parser
Set $this->attrName with given attribute name, normalized
Set $this->tagName with given tag name, normalized
Forward all unknown method calls to $this->collection
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
Add an item to this collection
Test whether a given value is present in this collection
Delete an item from this collection
Test whether an item of given key exists
Return a value from this collection
Find the index of a given value
Normalize an item's key
Normalize a value for storage
is called with a key that already exists
Set and overwrite a value in this collection
Add a word to the list of uncensored words
Return a list of censored words
Generate a regexp that matches the given list of words
Empty this collection
Details
in
ConfiguratorBase at line 42
final
__construct(Configurator $configurator, array $overrideProps = [])
No description
at line 92
protected
setUp()
Plugin's setup
Will initialize its collection and create the plugin's tag if it does not exist
in
ConfiguratorBase at line 84
finalize()
Finalize this plugin's configuration
Executed by the configurator whenever the tags' config must be in a usable state:
- before the parser's config is generated
- before the renderer's stylesheet is generated
- before HTML5 rules are generated
As such, this method may be called multiple times during configuration
at line 46
array
asConfig()
No description
in
ConfiguratorBase at line 109
final array
getBaseProperties()
Return a list of base properties meant to be added to asConfig()'s return
NOTE: this final method exists so that the plugin's configuration can always specify those base properties, even if they're omitted from asConfig(). Going forward, this ensure that new base properties added to ConfiguratorBase appear in the plugin's config without having to update every plugin
at line 210
array
getJSHints()
Return additional hints used in the JavaScript parser
in
ConfiguratorBase at line 144
string|null
getJSParser()
Return this plugin's JavaScript parser
This is the base implementation, meant to be overridden by custom plugins. By default it returns the Parser.js file from stock plugins' directory, if available
in
ConfiguratorBase at line 167
Tag
getTag()
Return the tag associated with this plugin, if applicable
in
ConfiguratorBase at line 186
void
disableQuickMatch()
Disable quickMatch
in
ConfiguratorBase at line 197
protected void
setAttrName(string $attrName)
Set $this->attrName with given attribute name, normalized
in
ConfiguratorBase at line 213
void
setQuickMatch(string $quickMatch)
Set the quickMatch string
in
ConfiguratorBase at line 229
void
setRegexpLimit(int $limit)
Set the maximum number of regexp matches
in
ConfiguratorBase at line 247
protected void
setTagName(string $tagName)
Set $this->tagName with given tag name, normalized
in
CollectionProxy at line 36
mixed
__call(string $methodName, array $args)
Forward all unknown method calls to $this->collection
at line 46
bool
offsetExists(string|int $offset)
No description
at line 46
mixed
offsetGet(string|int $offset)
No description
at line 46
void
offsetSet(string|int $offset, mixed $value)
No description
at line 46
void
offsetUnset(string|int $offset)
No description
at line 46
int
count()
No description
at line 46
mixed
current()
No description
at line 46
int|string
key()
No description
at line 46
mixed
next()
No description
at line 46
void
rewind()
No description
at line 46
bool
valid()
No description
at line 46
mixed
add(string $key, mixed $value)
Add an item to this collection
at line 46
bool
contains(mixed $value)
Test whether a given value is present in this collection
at line 46
void
delete(string $key)
Delete an item from this collection
at line 46
bool
exists(string $key)
Test whether an item of given key exists
at line 46
mixed
get(string $key)
Return a value from this collection
at line 46
mixed
indexOf(mixed $value)
Find the index of a given value
at line 46
string
normalizeKey(string $key)
Normalize an item's key
at line 46
mixed
normalizeValue(mixed $value)
Normalize a value for storage
at line 46
string
onDuplicate(string|null $action) Query and set the action to take when add()
is called with a key that already exists
at line 46
mixed
set(string $key, mixed $value)
Set and overwrite a value in this collection
at line 128
void
allow(string $word)
Add a word to the list of uncensored words
at line 138
Helper
getHelper()
Return an instance of s9e\TextFormatter\Plugins\Censor\Helper
at line 233
protected string[]
getWords()
Return a list of censored words
at line 244
protected Regexp
getWordsRegexp(array $words)
Generate a regexp that matches the given list of words
at line 46
void
clear()
Empty this collection