]> scripts.mit.edu Git - autoinstallsdev/mediawiki.git/blob - vendor/wikimedia/remex-html/RemexHtml/Tokenizer/Attributes.php
MediaWiki 1.30.2
[autoinstallsdev/mediawiki.git] / vendor / wikimedia / remex-html / RemexHtml / Tokenizer / Attributes.php
1 <?php
2
3 namespace RemexHtml\Tokenizer;
4
5 /**
6  * Interface for attributes emitted by the tokenizer
7  */
8 interface Attributes extends \ArrayAccess, \IteratorAggregate {
9         /**
10          * Get the attributes as a key/value array
11          * @return string[string]
12          */
13         function getValues();
14
15         /**
16          * Get the attributes as an array of Attribute objects
17          * @return Attribute[string]
18          */
19         function getObjects();
20
21         /**
22          * Get the number of attributes. This may include duplicates, and so may
23          * be larger than count( $this->getValues() ). Including duplicates
24          * gives us an efficient way to distinguish zero attributes from non-zero
25          * but is not compliant with the spec, which states that duplicate
26          * attributes must be removed.
27          *
28          * @return integer
29          */
30         function count();
31
32         /**
33          * Add any attributes in the argument to $this, but if an attribute of the
34          * same name already exists, do not overwrite it.
35          *
36          * @param Attributes $other
37          */
38         function merge( Attributes $other );
39 }