function StringInputStream::__construct
Create a new InputStream wrapper.
Parameters
string $data Data to parse.:
string $encoding The encoding to use for the data.:
string $debug A fprintf format to use to echo the data on stdout.:
2 calls to StringInputStream::__construct()
- FileInputStream::__construct in vendor/
masterminds/ html5/ src/ HTML5/ Parser/ FileInputStream.php - Load a file input stream.
- FileInputStream::__construct in vendor/
masterminds/ html5/ src/ HTML5/ Parser/ FileInputStream.php - Load a file input stream.
1 method overrides StringInputStream::__construct()
- FileInputStream::__construct in vendor/
masterminds/ html5/ src/ HTML5/ Parser/ FileInputStream.php - Load a file input stream.
File
-
vendor/
masterminds/ html5/ src/ HTML5/ Parser/ StringInputStream.php, line 75
Class
Namespace
Masterminds\HTML5\ParserCode
public function __construct($data, $encoding = 'UTF-8', $debug = '') {
$data = UTF8Utils::convertToUTF8($data, $encoding);
if ($debug) {
fprintf(STDOUT, $debug, $data, strlen($data));
}
// There is good reason to question whether it makes sense to
// do this here, since most of these checks are done during
// parsing, and since this check doesn't actually *do* anything.
$this->errors = UTF8Utils::checkForIllegalCodepoints($data);
$data = $this->replaceLinefeeds($data);
$this->data = $data;
$this->char = 0;
$this->EOF = strlen($data);
}