protected function formatResponse($response)
    {
        if (static::FORMAT_ARRAY === $this->output) {
            $response = static::xmlToArray($response);
        } else if (static::FORMAT_JSON === $this->output) {
            $response = static::xmlToArray($response);
            $response = json_encode($response, JSON_UNESCAPED_SLASHES);
        }

        return $response;
    }
protected function formatResponse($response)
    {
        if (static::FORMAT_ARRAY === $this->output) {
            $response = static::xmlToArray($response);
        } else if (static::FORMAT_JSON === $this->output) {
            $response = static::xmlToArray($response);
            $response = json_encode($response, JSON_UNESCAPED_SLASHES);
        }

        return $response;
    }
protected function formatResponse ( $ response ) { if ( static :: FORMAT_ARRAY === $ this -> output ) { $ response = static :: xmlToArray ( $ response ) ; } else if ( static :: FORMAT_JSON === $ this -> output ) { $ response = static :: xmlToArray ( $ response ) ; $ response = json_encode ( $ response , JSON_UNESCAPED_SLASHES ) ; } return $ response ; }
Formats XML response to array or json

@param $response

@return array|string
Formats XML response to array or json