BufferJsonEncoder
class BufferJsonEncoder extends AbstractJsonEncoder (View source)
Encodes the given value as JSON and returns encoding result step by step.
Methods
Returns the list of errors that occurred during the last encoding process.
Returns the JSON encoded in the current step.
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.
Writes the JSON output to the step buffer.
Encodes the entire value as JSON and returns the value as a string.
Details
in AbstractJsonEncoder at line 54
__construct(mixed $value)
AbstractJsonEncoder constructor.
in AbstractJsonEncoder at line 68
$this
setOptions(int $options)
Sets the JSON encoding options.
in AbstractJsonEncoder at line 84
$this
setIndent(string|int $indent)
Sets the indent for the JSON output.
in AbstractJsonEncoder at line 98
string[]
getErrors()
Returns the list of errors that occurred during the last encoding process.
in AbstractJsonEncoder at line 107
protected array
getValueStack()
Returns the current encoding value stack.
in AbstractJsonEncoder at line 126
int|null
key()
Returns the current number of step in the encoder.
in AbstractJsonEncoder at line 137
bool
valid()
Tells if the encoder has a valid current state.
at line 52
mixed
current()
Returns the JSON encoded in the current step.
at line 33
rewind()
Returns the JSON encoding to the beginning.
at line 41
next()
Iterates the next token or tokens to the output stream.
in AbstractJsonEncoder at line 261
protected mixed
resolveValue(mixed $value)
Resolves the actual value of any given value that is about to be processed.
at line 62
protected void
write(string $string, int $token)
Writes the JSON output to the step buffer.
at line 21
string
encode()
Encodes the entire value as JSON and returns the value as a string.