public function decode($input)
    {
        set_error_handler(__CLASS__ . '::onError');
        $value = json_decode($input, true);
        restore_error_handler();

        if (($value === null) && (strtolower(trim($input)) !== 'null')) {
            $valuePhp = self::getValuePhp($input);
            throw new ErrorException("Invalid JSON: {$valuePhp}");
        }

        if (!$this->getReply($value, $output)) {
            $valuePhp = self::getValuePhp($input);
            throw new ErrorException("Invalid JSON-RPC 2.0 response: {$valuePhp}");
        }

        return $output;
    }
public function decode($input)
    {
        set_error_handler(__CLASS__ . '::onError');
        $value = json_decode($input, true);
        restore_error_handler();

        if (($value === null) && (strtolower(trim($input)) !== 'null')) {
            $valuePhp = self::getValuePhp($input);
            throw new ErrorException("Invalid JSON: {$valuePhp}");
        }

        if (!$this->getReply($value, $output)) {
            $valuePhp = self::getValuePhp($input);
            throw new ErrorException("Invalid JSON-RPC 2.0 response: {$valuePhp}");
        }

        return $output;
    }
public function decode ( $ input ) { set_error_handler ( __CLASS__ . '::onError' ) ; $ value = json_decode ( $ input , true ) ; restore_error_handler ( ) ; if ( ( $ value === null ) && ( strtolower ( trim ( $ input ) ) !== 'null' ) ) { $ valuePhp = self :: getValuePhp ( $ input ) ; throw new ErrorException ( "Invalid JSON: {$valuePhp}" ) ; } if ( ! $ this -> getReply ( $ value , $ output ) ) { $ valuePhp = self :: getValuePhp ( $ input ) ; throw new ErrorException ( "Invalid JSON-RPC 2.0 response: {$valuePhp}" ) ; } return $ output ; }
Translates a JSON-RPC 2.0 server reply into an array of "Response"
objects

@param string $input
String reply from a JSON-RPC 2.0 server

@return Response[]
Returns a zero-indexed array of "Response" objects

@throws ErrorException
Throws an "ErrorException" if the reply was not well-formed
Translates a JSON - RPC 2 . 0 server reply into an array of Response objects