Documentation

StringStream
in package
implements Stream

FinalYes
Tags
psalm-immutable

Table of Contents

Interfaces

Stream
Represents an input stream. This allows us to have different types of input, each with their own optimizations.

Properties

$position  : Position
$string  : string

Methods

__construct()  : mixed
__toString()  : string
isEOF()  : bool
Test if the stream is at its end.
position()  : Position
takeN()  : TakeResult
Try to extract a chunk of length $n, or if the stream is too short, the rest of the stream.
takeWhile()  : TakeResult
Extract a chunk of the stream, by taking tokens as long as the predicate holds. Return the chunk and the rest of the stream.

Properties

Methods

__construct()

public __construct(string $string[, Position|null $position = null ]) : mixed
APIYes
Parameters
$string : string
$position : Position|null = null

__toString()

public __toString() : string
Tags
psalm-mutation-free
Return values
string

isEOF()

Test if the stream is at its end.

public isEOF() : bool
Tags
inheritDoc
psalm-mutation-free
Return values
bool

takeN()

Try to extract a chunk of length $n, or if the stream is too short, the rest of the stream.

public takeN(int $n) : TakeResult
Parameters
$n : int
Tags
inheritDoc
psalm-mutation-free
Return values
TakeResult

takeWhile()

Extract a chunk of the stream, by taking tokens as long as the predicate holds. Return the chunk and the rest of the stream.

public takeWhile(callable $predicate) : TakeResult
Parameters
$predicate : callable
Tags
psalm-param

pure-callable(string) : bool $predicate

psalm-mutation-free
inheritDoc
Return values
TakeResult

        
On this page

Search results