Mercurial > hg > isophonics-drupal-site
comparison vendor/masterminds/html5/src/HTML5/Parser/InputStream.php @ 17:129ea1e6d783
Update, including to Drupal core 8.6.10
author | Chris Cannam |
---|---|
date | Thu, 28 Feb 2019 13:21:36 +0000 |
parents | 4c8ae668cc8c |
children |
comparison
equal
deleted
inserted
replaced
16:c2387f117808 | 17:129ea1e6d783 |
---|---|
1 <?php | 1 <?php |
2 | |
2 namespace Masterminds\HTML5\Parser; | 3 namespace Masterminds\HTML5\Parser; |
3 | 4 |
4 /** | 5 /** |
5 * Interface for stream readers. | 6 * Interface for stream readers. |
6 * | 7 * |
7 * The parser only reads from streams. Various input sources can write | 8 * The parser only reads from streams. Various input sources can write |
8 * an adapater to this InputStream. | 9 * an adapater to this InputStream. |
9 * | 10 * |
10 * Currently provided InputStream implementations include | 11 * Currently provided InputStream implementations include |
11 * FileInputStream and StringInputStream. | 12 * FileInputStream and StringInputStream. |
13 * | |
14 * @deprecated since 2.4, to remove in 3.0. Use a string in the scanner instead. | |
12 */ | 15 */ |
13 interface InputStream extends \Iterator | 16 interface InputStream extends \Iterator |
14 { | 17 { |
15 | |
16 /** | 18 /** |
17 * Returns the current line that is being consumed. | 19 * Returns the current line that is being consumed. |
18 * | 20 * |
19 * TODO: Move this to the scanner. | 21 * TODO: Move this to the scanner. |
20 */ | 22 */ |
45 * | 47 * |
46 * Matches as far as possible until we reach a certain set of bytes | 48 * Matches as far as possible until we reach a certain set of bytes |
47 * and returns the matched substring. | 49 * and returns the matched substring. |
48 * | 50 * |
49 * @see strcspn | 51 * @see strcspn |
50 * @param string $bytes | 52 * |
51 * Bytes to match. | 53 * @param string $bytes Bytes to match. |
52 * @param int $max | 54 * @param int $max Maximum number of bytes to scan. |
53 * Maximum number of bytes to scan. | 55 * |
54 * @return mixed Index or false if no match is found. You should use strong | 56 * @return mixed Index or false if no match is found. You should use strong |
55 * equality when checking the result, since index could be 0. | 57 * equality when checking the result, since index could be 0. |
56 */ | 58 */ |
57 public function charsUntil($bytes, $max = null); | 59 public function charsUntil($bytes, $max = null); |
58 | 60 |
59 /** | 61 /** |
60 * Returns the string so long as $bytes matches. | 62 * Returns the string so long as $bytes matches. |
61 * | 63 * |
62 * Matches as far as possible with a certain set of bytes | 64 * Matches as far as possible with a certain set of bytes |
63 * and returns the matched substring. | 65 * and returns the matched substring. |
64 * | 66 * |
65 * @see strspn | 67 * @see strspn |
66 * @param string $bytes | 68 * |
67 * A mask of bytes to match. If ANY byte in this mask matches the | 69 * @param string $bytes A mask of bytes to match. If ANY byte in this mask matches the |
68 * current char, the pointer advances and the char is part of the | 70 * current char, the pointer advances and the char is part of the |
69 * substring. | 71 * substring. |
70 * @param int $max | 72 * @param int $max The max number of chars to read. |
71 * The max number of chars to read. | |
72 */ | 73 */ |
73 public function charsWhile($bytes, $max = null); | 74 public function charsWhile($bytes, $max = null); |
74 | 75 |
75 /** | 76 /** |
76 * Unconsume one character. | 77 * Unconsume one character. |
77 * | 78 * |
78 * @param int $howMany | 79 * @param int $howMany The number of characters to move the pointer back. |
79 * The number of characters to move the pointer back. | |
80 */ | 80 */ |
81 public function unconsume($howMany = 1); | 81 public function unconsume($howMany = 1); |
82 | 82 |
83 /** | 83 /** |
84 * Retrieve the next character without advancing the pointer. | 84 * Retrieve the next character without advancing the pointer. |