src/JsonResponse.php
public function getArrayResponse()
    {
        $json = [];
        $json['jsonrpc'] = '2.0';

        if ($this->errorCode) {

            $json['error'] = [];
            $json['error']['code'] = $this->errorCode;
            $json['error']['message'] = $this->errorMessage;

            if (!empty($this->errorData)) {
                $json['error']['data'] = $this->errorData;
            }

        } else {
            $json['result'] = $this->result;
        }

        $json['id'] = !empty($this->id) ? $this->id : null;

        return $json;
    }
public function getArrayResponse()
    {
        $json = [];
        $json['jsonrpc'] = '2.0';

        if ($this->errorCode) {

            $json['error'] = [];
            $json['error']['code'] = $this->errorCode;
            $json['error']['message'] = $this->errorMessage;

            if (!empty($this->errorData)) {
                $json['error']['data'] = $this->errorData;
            }

        } else {
            $json['result'] = $this->result;
        }

        $json['id'] = !empty($this->id) ? $this->id : null;

        return $json;
    }
public function getArrayResponse ( ) { $ json = [ ] ; $ json [ 'jsonrpc' ] = '2.0' ; if ( $ this -> errorCode ) { $ json [ 'error' ] = [ ] ; $ json [ 'error' ] [ 'code' ] = $ this -> errorCode ; $ json [ 'error' ] [ 'message' ] = $ this -> errorMessage ; if ( ! empty ( $ this -> errorData ) ) { $ json [ 'error' ] [ 'data' ] = $ this -> errorData ; } } else { $ json [ 'result' ] = $ this -> result ; } $ json [ 'id' ] = ! empty ( $ this -> id ) ? $ this -> id : null ; return $ json ; }
Return array response.

@return array
Return array response .