class BBCode implements ConfigProvider

Traits

Provides magic get, set, isset and unset implementations

Properties

AttributeList $contentAttributes

List of attributes whose value is to be made the content between the BBCode's tags if it's not explicitly given

string $defaultAttribute

Name of the default attribute

bool $forceLookahead

Whether the parser should look ahead in the text for an end tag before adding a start tag

string $tagName

Name of the tag used to represent this BBCode in the intermediate representation

Methods

mixed
__get(string $propName)

Magic getter

void
__set(string $propName, mixed $propValue)

Magic setter

bool
__isset(string $propName)

Test whether a property is set

void
__unset(string $propName)

Unset a property, if the class supports it

__construct(array|null $options = null)

No description

array|Dictionary|null
asConfig()

Return an array-based representation of this object to be used for parsing

static string
normalizeName(string $bbcodeName)

Normalize the name of a BBCode

setDefaultAttribute(string $attrName)

Set the default attribute name for this BBCode

setTagName(string $tagName)

Set the tag name that represents this BBCode in the intermediate representation

Details

in Configurable at line 30
mixed __get(string $propName)

Magic getter

Will return $this->foo if it exists, then $this->getFoo() or will throw an exception if neither exists

Parameters

string $propName

Return Value

mixed

in Configurable at line 61
void __set(string $propName, mixed $propValue)

Magic setter

Will call $this->setFoo($propValue) if it exists, otherwise it will set $this->foo. If $this->foo is a NormalizedCollection, we do not replace it, instead we clear() it then fill it back up. It will not overwrite an object with a different incompatible object (of a different, non-extending class) and it will throw an exception if the PHP type cannot match without incurring data loss.

Parameters

string $propName
mixed $propValue

Return Value

void

in Configurable at line 147
bool __isset(string $propName)

Test whether a property is set

Parameters

string $propName

Return Value

bool

in Configurable at line 164
void __unset(string $propName)

Unset a property, if the class supports it

Parameters

string $propName

Return Value

void

at line 54
__construct(array|null $options = null)

No description

Parameters

array|null $options

This BBCode's options

at line 69
array|Dictionary|null asConfig()

Return an array-based representation of this object to be used for parsing

NOTE: if this method was named getConfig() it could interfere with magic getters from the Configurable trait

Return Value

array|Dictionary|null

at line 89
static string normalizeName(string $bbcodeName)

Normalize the name of a BBCode

Follows the same rules as tag names with one exception: "*" is kept for compatibility with other BBCode engines

Parameters

string $bbcodeName

Original name

Return Value

string

Normalized name

at line 109
setDefaultAttribute(string $attrName)

Set the default attribute name for this BBCode

Parameters

string $attrName

at line 119
setTagName(string $tagName)

Set the tag name that represents this BBCode in the intermediate representation

Parameters

string $tagName