Skip to content
This repository has been archived by the owner on Apr 23, 2021. It is now read-only.

Commit

Permalink
Apply fixes from StyleCI
Browse files Browse the repository at this point in the history
  • Loading branch information
justmd5 authored and StyleCIBot committed Oct 13, 2018
1 parent 4d78345 commit c57100b
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions src/Api.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ class Api extends AbstractAPI

public function __construct($key, $secret)
{
$this->key = $key;
$this->key = $key;
$this->secret = $secret;
}

Expand Down Expand Up @@ -49,16 +49,16 @@ private function signature($params)
*/
public function request($method, $params, $data_type = 'JSON')
{
$http = $this->getHttp();
$params = $this->paramsHandle($params);
$params['client_id'] = $this->key;
$http = $this->getHttp();
$params = $this->paramsHandle($params);
$params['client_id'] = $this->key;
$params['sign_method'] = 'md5';
$params['type'] = $method;
$params['data_type'] = $data_type;
$params['timestamp'] = strval(time());
$params['sign'] = $this->signature($params);
$response = call_user_func_array([$http, 'post'], [self::URL, $params]);
$responseBody = strval($response->getBody());
$params['type'] = $method;
$params['data_type'] = $data_type;
$params['timestamp'] = strval(time());
$params['sign'] = $this->signature($params);
$response = call_user_func_array([$http, 'post'], [self::URL, $params]);
$responseBody = strval($response->getBody());

return strtolower($data_type) == 'json' ? json_decode($responseBody, true) : $responseBody;
}
Expand Down

0 comments on commit c57100b

Please sign in to comment.