final |
|---|
Reads unfolded content lines (RFC 5545, section 3.1) from a stream, a file or a string. The input is processed in chunks, so memory use does not depend on its size. CRLF, LF and CR line breaks are accepted, folded lines (continued by a space or a tab) are joined, empty lines and a UTF-8 byte order mark are skipped. Keys of the generators are the numbers of the first physical line of each content line.
| Methods | ||
|---|---|---|
public
static
|
fromString(
string $content,
int $maxLineLength = PHP_INT_MAX,
int $maxSize = PHP_INT_MAX,
?(callable(string, string, int): void) $warn = null,
): Generator<int, string>
|
# |
public
static
|
fromFile(
string $file,
int $maxLineLength = PHP_INT_MAX,
int $maxSize = PHP_INT_MAX,
?(callable(string, string, int): void) $warn = null,
): Generator<int, string>
|
# |
public
static
|
fromStream(
resource $stream,
int $maxLineLength = PHP_INT_MAX,
int $maxSize = PHP_INT_MAX,
?(callable(string, string, int): void) $warn = null,
): Generator<int, string>
|
# |