mirror of
https://gitee.com/fastadminnet/framework.git
synced 2026-07-06 23:02:48 +08:00
数组定义规范统一
This commit is contained in:
@@ -173,7 +173,7 @@ abstract class Driver {
|
||||
* @param string $method 请求方法GET/POST
|
||||
* @return array $data 响应数据
|
||||
*/
|
||||
protected function http($url, $params, $method = 'GET', $header = array()){
|
||||
protected function http($url, $params, $method = 'GET', $header = []){
|
||||
$vars = http_build_query($params);
|
||||
$opts = array(
|
||||
CURLOPT_TIMEOUT => 30,
|
||||
|
||||
@@ -39,7 +39,7 @@ class Douban extends Driver{
|
||||
*/
|
||||
public function call($api, $param = '', $method = 'GET'){
|
||||
/* 豆瓣调用公共参数 */
|
||||
$params = array();
|
||||
$params = [];
|
||||
$header = array("Authorization: Bearer {$this->token['access_token']}");
|
||||
$data = $this->http($this->url($api), $this->param($params, $param), $method, $header);
|
||||
return json_decode($data, true);
|
||||
|
||||
@@ -39,7 +39,7 @@ class Github extends Driver{
|
||||
*/
|
||||
public function call($api, $param = '', $method = 'GET'){
|
||||
/* Github 调用公共参数 */
|
||||
$params = array();
|
||||
$params = [];
|
||||
$header = array("Authorization: bearer {$this->token['access_token']}");
|
||||
|
||||
$data = $this->http($this->url($api), $this->param($params, $param), $method, $header);
|
||||
|
||||
@@ -45,7 +45,7 @@ class Google extends Driver{
|
||||
*/
|
||||
public function call($api, $param = '', $method = 'GET'){
|
||||
/* Google 调用公共参数 */
|
||||
$params = array();
|
||||
$params = [];
|
||||
$header = array("Authorization: Bearer {$this->token['access_token']}");
|
||||
|
||||
$data = $this->http($this->url($api), $this->param($params, $param), $method, $header);
|
||||
|
||||
@@ -61,7 +61,7 @@ class Renren extends Driver{
|
||||
|
||||
/* 签名 */
|
||||
ksort($params);
|
||||
$param = array();
|
||||
$param = [];
|
||||
foreach ($params as $key => $value){
|
||||
$param[] = "{$key}={$value}";
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user