AbstractJsonEncoder
class AbstractJsonEncoder implements Iterator (View source)
Abstract encoder for encoding JSON iteratively.
Methods
AbstractJsonEncoder constructor.
Sets the JSON encoding options.
Sets the indent for the JSON output.
Returns the list of errors that occurred during the last encoding process.
Returns the current encoding value stack.
Returns the current number of step in the encoder.
Tells if the encoder has a valid current state.
Returns the current value or state from the encoder.
Returns the JSON encoding to the beginning.
Iterates the next token or tokens to the output stream.
Resolves the actual value of any given value that is about to be processed.
Actually handles the writing of the given token to the output stream.
Details
at line 54
__construct(mixed $value)
AbstractJsonEncoder constructor.
at line 68
$this
setOptions(int $options)
Sets the JSON encoding options.
at line 84
$this
setIndent(string|int $indent)
Sets the indent for the JSON output.
at line 98
string[]
getErrors()
Returns the list of errors that occurred during the last encoding process.
at line 107
protected array
getValueStack()
Returns the current encoding value stack.
at line 126
int|null
key()
Returns the current number of step in the encoder.
at line 137
bool
valid()
Tells if the encoder has a valid current state.
at line 148
abstract mixed
current()
Returns the current value or state from the encoder.
at line 153
rewind()
Returns the JSON encoding to the beginning.
at line 175
next()
Iterates the next token or tokens to the output stream.
at line 261
protected mixed
resolveValue(mixed $value)
Resolves the actual value of any given value that is about to be processed.
at line 466
abstract protected void
write(string $string, int $token)
Actually handles the writing of the given token to the output stream.