Skip to content

Commit

Permalink
CS
Browse files Browse the repository at this point in the history
  • Loading branch information
overtrue committed Feb 11, 2015
1 parent c87b86b commit 62d273e
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions src/Wechat/Wechat.php
Original file line number Diff line number Diff line change
Expand Up @@ -148,9 +148,7 @@ public function on($target, $type, $callback = null)
throw new Exception("$callback 不是一个可调用的函数或方法");
}

if (!$listeners = $this->listeners->get("{$target}.{$type}")) {
$listeners = array();
}
$listeners = $this->listeners->get("{$target}.{$type}") ? : array();

array_push($listeners, $callback);

Expand Down Expand Up @@ -281,9 +279,7 @@ static public function makeUrl($url, $queries = array())
throw new Exception("请先初始化Wechat类");
}

if (self::$autoToken) {
$queries['access_token'] = self::$instance->getAccessToken();
}
!self::$autoToken || $queries['access_token'] = self::$instance->getAccessToken();

return $url . (empty($queries) ? '' : ('?' . http_build_query($queries)));
}
Expand Down

0 comments on commit 62d273e

Please sign in to comment.