Skip to content

Commit

Permalink
Merge pull request #303 from jinchun/master
Browse files Browse the repository at this point in the history
Fix code style and some spelling mistakes
  • Loading branch information
overtrue committed Feb 24, 2016
2 parents 9af8a3a + 9d70dfe commit 67f54e6
Show file tree
Hide file tree
Showing 11 changed files with 26 additions and 16 deletions.
4 changes: 2 additions & 2 deletions src/Core/AbstractAPI.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ abstract class AbstractAPI
protected $http;

/**
* The reqeust token.
* The request token.
*
* @var \EasyWeChat\Core\AccessToken
*/
Expand Down Expand Up @@ -219,7 +219,7 @@ protected function retryMiddleware()
}

/**
* Check the array data erros, and Throw expcetion when the contents cotnains error.
* Check the array data errors, and Throw exception when the contents contains error.
*
* @param array $contents
*
Expand Down
10 changes: 7 additions & 3 deletions src/Core/AccessToken.php
Original file line number Diff line number Diff line change
Expand Up @@ -77,9 +77,9 @@ class AccessToken
/**
* Constructor.
*
* @param string $appId
* @param string $secret
* @param Doctrine\Common\Cache\Cache $cache
* @param string $appId
* @param string $secret
* @param \Doctrine\Common\Cache\Cache $cache
*/
public function __construct($appId, $secret, Cache $cache = null)
{
Expand Down Expand Up @@ -137,6 +137,8 @@ public function getSecret()
* Set cache instance.
*
* @param \Doctrine\Common\Cache\Cache $cache
*
* @return AccessToken
*/
public function setCache(Cache $cache)
{
Expand Down Expand Up @@ -192,6 +194,8 @@ public function getQueryFields()
/**
* Get the access token from WeChat server.
*
* @throws \EasyWeChat\Core\Exceptions\HttpException
*
* @return array|bool
*/
public function getTokenFromServer()
Expand Down
6 changes: 3 additions & 3 deletions src/Js/Js.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
class Js extends AbstractAPI
{
/**
* Cacher.
* Cache.
*
* @var Cache
*/
Expand Down Expand Up @@ -185,7 +185,7 @@ public function getUrl()
/**
* Set cache manager.
*
* @param Doctrine\Common\Cache\Cache $cache
* @param \Doctrine\Common\Cache\Cache $cache
*
* @return $this
*/
Expand All @@ -199,7 +199,7 @@ public function setCache(Cache $cache)
/**
* Return cache manager.
*
* @return Doctrine\Common\Cache\Cache
* @return \Doctrine\Common\Cache\Cache
*/
public function getCache()
{
Expand Down
2 changes: 1 addition & 1 deletion src/Notice/Notice.php
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ public function send($data = [])

foreach ($params as $key => $value) {
if (in_array($key, $required, true) && empty($value) && empty($this->message[$key])) {
throw new InvalidArgumentException("Attibute '$key' can not be empty!");
throw new InvalidArgumentException("Attribute '$key' can not be empty!");
}

$params[$key] = empty($value) ? $this->message[$key] : $value;
Expand Down
2 changes: 1 addition & 1 deletion src/Payment/API.php
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,7 @@ public function queryRefundByRefundId($refundId)
* @param string $date
* @param string $type
*
* @return stream
* @return \EasyWeChat\Support\Collection
*/
public function downloadBill($date, $type = self::BILL_TYPE_ALL)
{
Expand Down
2 changes: 2 additions & 0 deletions src/Payment/Notify.php
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,8 @@ public function isValid()
* Return the notify body from request.
*
* @return \EasyWeChat\Support\Collection
*
* @throws \EasyWeChat\Core\Exceptions\FaultException
*/
public function getNotify()
{
Expand Down
4 changes: 4 additions & 0 deletions src/Server/Guard.php
Original file line number Diff line number Diff line change
Expand Up @@ -218,9 +218,13 @@ public function getEncryptor()
/**
* Build response.
*
* @param $to
* @param $from
* @param mixed $message
*
* @return string
*
* @throws \EasyWeChat\Core\Exceptions\InvalidArgumentException
*/
protected function buildResponse($to, $from, $message)
{
Expand Down
2 changes: 1 addition & 1 deletion src/Server/Transformer.php
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ public function transformTransfer(AbstractMessage $message)
/**
* Transform news message.
*
* @param array|EasyWeChat\Message\News $news
* @param array|\EasyWeChat\Message\News $news
*
* @return array
*/
Expand Down
4 changes: 3 additions & 1 deletion src/Support/Attribute.php
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,8 @@ public function getAttribute($attribute, $default)
* @param mixed $value
*
* @return Attribute
*
* @throws \EasyWeChat\Core\Exceptions\InvalidArgumentException
*/
public function with($attribute, $value)
{
Expand Down Expand Up @@ -130,7 +132,7 @@ protected function validate($attribute, $value)
*/
public function set($attribute, $value = null)
{
return parent::set($this->getRealKey($attribute), $value);
parent::set($this->getRealKey($attribute), $value);
}

/**
Expand Down
2 changes: 1 addition & 1 deletion src/Support/Collection.php
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ public function get($key, $default = null)
*/
public function forget($key)
{
return Arr::forget($this->items, $key);
Arr::forget($this->items, $key);
}

/**
Expand Down
4 changes: 1 addition & 3 deletions src/Support/XML.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,7 @@ class XML
*
* @param string $xml XML string
*
* @return array
*
* @throws InvalidArgumentException
* @return array|\SimpleXMLElement
*/
public static function parse($xml)
{
Expand Down

0 comments on commit 67f54e6

Please sign in to comment.