]> scripts.mit.edu Git - autoinstallsdev/mediawiki.git/blobdiff - vendor/wikimedia/remex-html/RemexHtml/Tokenizer/Attributes.php
MediaWiki 1.30.2
[autoinstallsdev/mediawiki.git] / vendor / wikimedia / remex-html / RemexHtml / Tokenizer / Attributes.php
diff --git a/vendor/wikimedia/remex-html/RemexHtml/Tokenizer/Attributes.php b/vendor/wikimedia/remex-html/RemexHtml/Tokenizer/Attributes.php
new file mode 100644 (file)
index 0000000..fa6c465
--- /dev/null
@@ -0,0 +1,39 @@
+<?php
+
+namespace RemexHtml\Tokenizer;
+
+/**
+ * Interface for attributes emitted by the tokenizer
+ */
+interface Attributes extends \ArrayAccess, \IteratorAggregate {
+       /**
+        * Get the attributes as a key/value array
+        * @return string[string]
+        */
+       function getValues();
+
+       /**
+        * Get the attributes as an array of Attribute objects
+        * @return Attribute[string]
+        */
+       function getObjects();
+
+       /**
+        * 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.
+        *
+        * @return integer
+        */
+       function count();
+
+       /**
+        * Add any attributes in the argument to $this, but if an attribute of the
+        * same name already exists, do not overwrite it.
+        *
+        * @param Attributes $other
+        */
+       function merge( Attributes $other );
+}