src/AbstractJsonEncoder.php
private function outputJson($value, $token)
    {
        $encoded = json_encode($value, $this->options);
        $error = json_last_error();

        if ($error !== JSON_ERROR_NONE) {
            $this->addError(sprintf('%s (%s)', json_last_error_msg(), $this->getJsonErrorName($error)));
        }

        $this->output($encoded, $token);
    }
private function outputJson($value, $token)
    {
        $encoded = json_encode($value, $this->options);
        $error = json_last_error();

        if ($error !== JSON_ERROR_NONE) {
            $this->addError(sprintf('%s (%s)', json_last_error_msg(), $this->getJsonErrorName($error)));
        }

        $this->output($encoded, $token);
    }
private function outputJson ( $ value , $ token ) { $ encoded = json_encode ( $ value , $ this -> options ) ; $ error = json_last_error ( ) ; if ( $ error !== JSON_ERROR_NONE ) { $ this -> addError ( sprintf ( '%s (%s)' , json_last_error_msg ( ) , $ this -> getJsonErrorName ( $ error ) ) ) ; } $ this -> output ( $ encoded , $ token ) ; }
Encodes the given value as JSON and passes it to output stream.
@param mixed $value The value to output as JSON
@param int $token The token type of the value
Encodes the given value as JSON and passes it to output stream .