RemexHtml
Fast HTML 5 parser
|
An Attributes implementation which is a simple array proxy. More...
Public Member Functions | |
__construct ( $data=[]) | |
merge (Attributes $other) | |
Add any attributes in the argument to $this, but if an attribute of the same name already exists, do not overwrite it. | |
offsetExists ( $key) | |
& | offsetGet ( $key) |
offsetSet ( $key, $value) | |
offsetUnset ( $key) | |
getIterator () | |
getValues () | |
Get the attributes as a key/value array. | |
getObjects () | |
Get the attributes as an array of Attribute objects. | |
count () | |
Get the number of attributes. | |
clone () | |
It's efficient to assume that attributes are immutable when cloning nodes due to AFE reconstruction or AAA. | |
Protected Attributes | |
$data | |
$attrObjects | |
An Attributes implementation which is a simple array proxy.
Wikimedia\RemexHtml\Tokenizer\PlainAttributes::clone | ( | ) |
It's efficient to assume that attributes are immutable when cloning nodes due to AFE reconstruction or AAA.
So by default, this returns $this. But users can override it if attribute cloning needs special handling.
Implements Wikimedia\RemexHtml\Tokenizer\Attributes.
Wikimedia\RemexHtml\Tokenizer\PlainAttributes::count | ( | ) |
Get the number of attributes.
This may include duplicates, and so may be larger than count( $this->getValues() ). Including duplicates gives us an efficient way to distinguish zero attributes from non-zero but is not compliant with the spec, which states that duplicate attributes must be removed.
Implements Wikimedia\RemexHtml\Tokenizer\Attributes.
Wikimedia\RemexHtml\Tokenizer\PlainAttributes::getObjects | ( | ) |
Get the attributes as an array of Attribute objects.
Implements Wikimedia\RemexHtml\Tokenizer\Attributes.
Wikimedia\RemexHtml\Tokenizer\PlainAttributes::getValues | ( | ) |
Get the attributes as a key/value array.
Implements Wikimedia\RemexHtml\Tokenizer\Attributes.
Wikimedia\RemexHtml\Tokenizer\PlainAttributes::merge | ( | Attributes | $other | ) |
Add any attributes in the argument to $this, but if an attribute of the same name already exists, do not overwrite it.
Attributes | $other |
Implements Wikimedia\RemexHtml\Tokenizer\Attributes.