← All changes
|
vendor/masterminds/html5/src/HTML5/Parser/StringInputStream.php
+15
-15
3.0.10
→
3.2.89
View file →
| @@ -64,9 +64,9 @@ | ||
| 64 | 64 | public function __construct($data, $encoding = 'UTF-8', $debug = '') |
| 65 | 65 | { |
| 66 | 66 | $data = UTF8Utils::convertToUTF8($data, $encoding); |
| 67 | 67 | if ($debug) { |
| 68 | - \fprintf(\STDOUT, $debug, $data, \strlen($data)); | |
| 68 | + fprintf(\STDOUT, $debug, $data, strlen($data)); | |
| 69 | 69 | } |
| 70 | 70 | // There is good reason to question whether it makes sense to |
| 71 | 71 | // do this here, since most of these checks are done during |
| 72 | 72 | // parsing, and since this check doesn't actually *do* anything. |
| @@ -73,9 +73,9 @@ | ||
| 73 | 73 | $this->errors = UTF8Utils::checkForIllegalCodepoints($data); |
| 74 | 74 | $data = $this->replaceLinefeeds($data); |
| 75 | 75 | $this->data = $data; |
| 76 | 76 | $this->char = 0; |
| 77 | - $this->EOF = \strlen($data); | |
| 77 | + $this->EOF = strlen($data); | |
| 78 | 78 | } |
| 79 | 79 | public function __toString() |
| 80 | 80 | { |
| 81 | 81 | return $this->data; |
| @@ -92,9 +92,9 @@ | ||
| 92 | 92 | * represented by LF characters, and there are never any CR characters in the input to the tokenization |
| 93 | 93 | * stage. |
| 94 | 94 | */ |
| 95 | 95 | $crlfTable = array("\x00" => "�", "\r\n" => "\n", "\r" => "\n"); |
| 96 | - return \strtr($data, $crlfTable); | |
| 96 | + return strtr($data, $crlfTable); | |
| 97 | 97 | } |
| 98 | 98 | /** |
| 99 | 99 | * Returns the current line that the tokenizer is at. |
| 100 | 100 | */ |
| @@ -104,9 +104,9 @@ | ||
| 104 | 104 | return 1; |
| 105 | 105 | } |
| 106 | 106 | // Add one to $this->char because we want the number for the next |
| 107 | 107 | // byte to be processed. |
| 108 | - return \substr_count($this->data, "\n", 0, \min($this->char, $this->EOF)) + 1; | |
| 108 | + return substr_count($this->data, "\n", 0, min($this->char, $this->EOF)) + 1; | |
| 109 | 109 | } |
| 110 | 110 | /** |
| 111 | 111 | * @deprecated |
| 112 | 112 | */ |
| @@ -130,17 +130,17 @@ | ||
| 130 | 130 | // want (i.e., the last \n before $this->char). This needs to not have |
| 131 | 131 | // one (to make it point to the next character, the one we want the |
| 132 | 132 | // position of) added to it because strrpos's behaviour includes the |
| 133 | 133 | // final offset byte. |
| 134 | - $backwardFrom = $this->char - 1 - \strlen($this->data); | |
| 135 | - $lastLine = \strrpos($this->data, "\n", $backwardFrom); | |
| 134 | + $backwardFrom = $this->char - 1 - strlen($this->data); | |
| 135 | + $lastLine = strrpos($this->data, "\n", $backwardFrom); | |
| 136 | 136 | // However, for here we want the length up until the next byte to be |
| 137 | 137 | // processed, so add one to the current byte ($this->char). |
| 138 | 138 | if (\false !== $lastLine) { |
| 139 | - $findLengthOf = \substr($this->data, $lastLine + 1, $this->char - 1 - $lastLine); | |
| 139 | + $findLengthOf = substr($this->data, $lastLine + 1, $this->char - 1 - $lastLine); | |
| 140 | 140 | } else { |
| 141 | 141 | // After a newline. |
| 142 | - $findLengthOf = \substr($this->data, 0, $this->char); | |
| 142 | + $findLengthOf = substr($this->data, 0, $this->char); | |
| 143 | 143 | } |
| 144 | 144 | return UTF8Utils::countChars($findLengthOf); |
| 145 | 145 | } |
| 146 | 146 | /** |
| @@ -200,9 +200,9 @@ | ||
| 200 | 200 | */ |
| 201 | 201 | public function remainingChars() |
| 202 | 202 | { |
| 203 | 203 | if ($this->char < $this->EOF) { |
| 204 | - $data = \substr($this->data, $this->char); | |
| 204 | + $data = substr($this->data, $this->char); | |
| 205 | 205 | $this->char = $this->EOF; |
| 206 | 206 | return $data; |
| 207 | 207 | } |
| 208 | 208 | return ''; |
| @@ -227,13 +227,13 @@ | ||
| 227 | 227 | if ($this->char >= $this->EOF) { |
| 228 | 228 | return \false; |
| 229 | 229 | } |
| 230 | 230 | if (0 === $max || $max) { |
| 231 | - $len = \strcspn($this->data, $bytes, $this->char, $max); | |
| 231 | + $len = strcspn($this->data, $bytes, $this->char, $max); | |
| 232 | 232 | } else { |
| 233 | - $len = \strcspn($this->data, $bytes, $this->char); | |
| 233 | + $len = strcspn($this->data, $bytes, $this->char); | |
| 234 | 234 | } |
| 235 | - $string = (string) \substr($this->data, $this->char, $len); | |
| 235 | + $string = (string) substr($this->data, $this->char, $len); | |
| 236 | 236 | $this->char += $len; |
| 237 | 237 | return $string; |
| 238 | 238 | } |
| 239 | 239 | /** |
| @@ -254,13 +254,13 @@ | ||
| 254 | 254 | if ($this->char >= $this->EOF) { |
| 255 | 255 | return \false; |
| 256 | 256 | } |
| 257 | 257 | if (0 === $max || $max) { |
| 258 | - $len = \strspn($this->data, $bytes, $this->char, $max); | |
| 258 | + $len = strspn($this->data, $bytes, $this->char, $max); | |
| 259 | 259 | } else { |
| 260 | - $len = \strspn($this->data, $bytes, $this->char); | |
| 260 | + $len = strspn($this->data, $bytes, $this->char); | |
| 261 | 261 | } |
| 262 | - $string = (string) \substr($this->data, $this->char, $len); | |
| 262 | + $string = (string) substr($this->data, $this->char, $len); | |
| 263 | 263 | $this->char += $len; |
| 264 | 264 | return $string; |
| 265 | 265 | } |
| 266 | 266 | /** |