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 $quickMatch {@inheritdoc}
protected int $regexpLimit from  ConfiguratorBase
BBCodeCollection $collection
BBCodeMonkey $bbcodeMonkey
protected $regexp {@inheritdoc}
RepositoryCollection $repositories

Methods

__construct(Configurator $configurator, array $overrideProps = [])

No description

setUp()

Plugin setup

finalize()

Finalize this plugin's configuration

array
asConfig()

No description

array
getBaseProperties()

Return a list of base properties meant to be added to asConfig()'s return

array
getJSHints()

Return additional hints used in the JavaScript parser

string|null
getJSParser()

Return this plugin's JavaScript parser

Tag
getTag()

Return the tag associated with this plugin, if applicable

void
disableQuickMatch()

Disable quickMatch

void
setAttrName(string $attrName)

Set $this->attrName with given attribute name, normalized

void
setQuickMatch(string $quickMatch)

Set the quickMatch string

void
setRegexpLimit(int $limit)

Set the maximum number of regexp matches

void
setTagName(string $tagName)

Set $this->tagName with given tag name, normalized

mixed
__call(string $methodName, array $args)

Forward all unknown method calls to $this->collection

bool
offsetExists(string|int $offset)

No description

mixed
offsetGet(string|int $offset)

No description

void
offsetSet(string|int $offset, mixed $value)

No description

void
offsetUnset(string|int $offset)

No description

int
count()

No description

mixed
current()

No description

int|string
key()

No description

mixed
next()

No description

void
rewind()

No description

bool
valid()

No description

mixed
add(string $key, mixed $value)

Add an item to this collection

bool
contains(mixed $value)

Test whether a given value is present in this collection

void
delete(string $key)

Delete an item from this collection

bool
exists(string $key)

Test whether an item of given key exists

mixed
get(string $key)

Return a value from this collection

mixed
indexOf(mixed $value)

Find the index of a given value

string
normalizeKey(string $key)

Normalize an item's key

mixed
normalizeValue(mixed $value)

Normalize a value for storage

string
onDuplicate(string|null $action) Query and set the action to take when add()

is called with a key that already exists

mixed
set(string $key, mixed $value)

Set and overwrite a value in this collection

addCustom(string $usage, string|Template $template, array $options = [])

Add a BBCode using their human-readable representation

addFromRepository(string $name, mixed $repository = 'default', array $vars = [])

Add a BBCode from a repository

addFromConfig(array $config)

Add a BBCode and its tag based on the return config from BBCodeMonkey

void
clear()

Empty this collection

Details

in ConfiguratorBase at line 42
final __construct(Configurator $configurator, array $overrideProps = [])

No description

Parameters

Configurator $configurator
array $overrideProps

Properties of the plugin will be overwritten with those

at line 84
protected setUp()

Plugin setup

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 50
array asConfig()

No description

Return Value

array

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

Return Value

array

in ConfiguratorBase at line 131
array getJSHints()

Return additional hints used in the JavaScript parser

Return Value

array

Hint names and values

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

Return Value

string|null

JavaScript source, or NULL if no JS parser is available

in ConfiguratorBase at line 167
Tag getTag()

Return the tag associated with this plugin, if applicable

Return Value

Tag

in ConfiguratorBase at line 186
void disableQuickMatch()

Disable quickMatch

Return Value

void

in ConfiguratorBase at line 197
protected void setAttrName(string $attrName)

Set $this->attrName with given attribute name, normalized

Parameters

string $attrName

New attribute name

Return Value

void

in ConfiguratorBase at line 213
void setQuickMatch(string $quickMatch)

Set the quickMatch string

Parameters

string $quickMatch

Return Value

void

in ConfiguratorBase at line 229
void setRegexpLimit(int $limit)

Set the maximum number of regexp matches

Parameters

int $limit

Return Value

void

in ConfiguratorBase at line 247
protected void setTagName(string $tagName)

Set $this->tagName with given tag name, normalized

Parameters

string $tagName

New tag name

Return Value

void

in CollectionProxy at line 36
mixed __call(string $methodName, array $args)

Forward all unknown method calls to $this->collection

Parameters

string $methodName
array $args

Return Value

mixed

at line 50
bool offsetExists(string|int $offset)

No description

Parameters

string|int $offset

Return Value

bool

at line 50
mixed offsetGet(string|int $offset)

No description

Parameters

string|int $offset

Return Value

mixed

at line 50
void offsetSet(string|int $offset, mixed $value)

No description

Parameters

string|int $offset
mixed $value

Return Value

void

at line 50
void offsetUnset(string|int $offset)

No description

Parameters

string|int $offset

Return Value

void

at line 50
int count()

No description

Return Value

int

at line 50
mixed current()

No description

Return Value

mixed

at line 50
int|string key()

No description

Return Value

int|string

at line 50
mixed next()

No description

Return Value

mixed

at line 50
void rewind()

No description

Return Value

void

at line 50
bool valid()

No description

Return Value

bool

at line 50
mixed add(string $key, mixed $value)

Add an item to this collection

Parameters

string $key
mixed $value

Return Value

mixed

at line 50
bool contains(mixed $value)

Test whether a given value is present in this collection

Parameters

mixed $value

Return Value

bool

at line 50
void delete(string $key)

Delete an item from this collection

Parameters

string $key

Return Value

void

at line 50
bool exists(string $key)

Test whether an item of given key exists

Parameters

string $key

Return Value

bool

at line 50
mixed get(string $key)

Return a value from this collection

Parameters

string $key

Return Value

mixed

at line 50
mixed indexOf(mixed $value)

Find the index of a given value

Parameters

mixed $value

Return Value

mixed

at line 50
string normalizeKey(string $key)

Normalize an item's key

Parameters

string $key

Return Value

string

at line 50
mixed normalizeValue(mixed $value)

Normalize a value for storage

Parameters

mixed $value

Return Value

mixed

at line 50
string onDuplicate(string|null $action) Query and set the action to take when add()

is called with a key that already exists

Parameters

string|null $action) Query and set the action to take when add(

Return Value

string

at line 50
mixed set(string $key, mixed $value)

Set and overwrite a value in this collection

Parameters

string $key
mixed $value

Return Value

mixed

at line 102
BBCode addCustom(string $usage, string|Template $template, array $options = [])

Add a BBCode using their human-readable representation

Parameters

string $usage

BBCode's usage

string|Template $template

BBCode's template

array $options

Supported: 'tagName' and 'rules'

Return Value

BBCode

Newly-created BBCode

See also

BBCodeMonkey

at line 127
BBCode addFromRepository(string $name, mixed $repository = 'default', array $vars = [])

Add a BBCode from a repository

Parameters

string $name

Name of the entry in the repository

mixed $repository

Name of the repository to use as source, or instance of Repository

array $vars

Variables that will replace default values in the tag definition

Return Value

BBCode

Newly-created BBCode

at line 149
protected BBCode addFromConfig(array $config)

Add a BBCode and its tag based on the return config from BBCodeMonkey

Parameters

array $config

BBCodeMonkey::create()'s return array

Return Value

BBCode

at line 50
void clear()

Empty this collection

Return Value

void