diff options
author | Andrew Dolgov <[email protected]> | 2022-07-24 14:03:04 +0300 |
---|---|---|
committer | Andrew Dolgov <[email protected]> | 2022-07-24 14:03:04 +0300 |
commit | 5006c754c42a09f5b88b258c2da4b9eff7508357 (patch) | |
tree | 841425d4e163d746642d70b8ac0df381343bbf2b /plugins/af_readability/vendor/masterminds/html5/src/HTML5/Parser/InputStream.php | |
parent | f7b3c50828d4604ac5999daf3c3405e65c877e2f (diff) |
readability: add missing dependencies
Diffstat (limited to 'plugins/af_readability/vendor/masterminds/html5/src/HTML5/Parser/InputStream.php')
-rw-r--r-- | plugins/af_readability/vendor/masterminds/html5/src/HTML5/Parser/InputStream.php | 87 |
1 files changed, 87 insertions, 0 deletions
diff --git a/plugins/af_readability/vendor/masterminds/html5/src/HTML5/Parser/InputStream.php b/plugins/af_readability/vendor/masterminds/html5/src/HTML5/Parser/InputStream.php new file mode 100644 index 000000000..ff4ef2266 --- /dev/null +++ b/plugins/af_readability/vendor/masterminds/html5/src/HTML5/Parser/InputStream.php @@ -0,0 +1,87 @@ +<?php + +namespace Masterminds\HTML5\Parser; + +/** + * Interface for stream readers. + * + * The parser only reads from streams. Various input sources can write + * an adapater to this InputStream. + * + * Currently provided InputStream implementations include + * FileInputStream and StringInputStream. + * + * @deprecated since 2.4, to remove in 3.0. Use a string in the scanner instead. + */ +interface InputStream extends \Iterator +{ + /** + * Returns the current line that is being consumed. + * + * TODO: Move this to the scanner. + */ + public function currentLine(); + + /** + * Returns the current column of the current line that the tokenizer is at. + * + * Newlines are column 0. The first char after a newline is column 1. + * + * @TODO Move this to the scanner. + * + * @return int The column number. + */ + public function columnOffset(); + + /** + * Get all characters until EOF. + * + * This consumes characters until the EOF. + */ + public function remainingChars(); + + /** + * Read to a particular match (or until $max bytes are consumed). + * + * This operates on byte sequences, not characters. + * + * Matches as far as possible until we reach a certain set of bytes + * and returns the matched substring. + * + * @see strcspn + * + * @param string $bytes Bytes to match. + * @param int $max Maximum number of bytes to scan. + * + * @return mixed Index or false if no match is found. You should use strong + * equality when checking the result, since index could be 0. + */ + public function charsUntil($bytes, $max = null); + + /** + * Returns the string so long as $bytes matches. + * + * Matches as far as possible with a certain set of bytes + * and returns the matched substring. + * + * @see strspn + * + * @param string $bytes A mask of bytes to match. If ANY byte in this mask matches the + * current char, the pointer advances and the char is part of the + * substring. + * @param int $max The max number of chars to read. + */ + public function charsWhile($bytes, $max = null); + + /** + * Unconsume one character. + * + * @param int $howMany The number of characters to move the pointer back. + */ + public function unconsume($howMany = 1); + + /** + * Retrieve the next character without advancing the pointer. + */ + public function peek(); +} |