Skip to content

Commit

Permalink
Merge pull request #39 from TheNorthMemory/master
Browse files Browse the repository at this point in the history
docline comments & fix AccessToken parameter typos
  • Loading branch information
overtrue committed Jun 4, 2015
2 parents 5dbe32a + 9b7afc6 commit 43a6bac
Show file tree
Hide file tree
Showing 16 changed files with 59 additions and 29 deletions.
4 changes: 3 additions & 1 deletion src/Wechat/AccessToken.php
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,9 @@ class AccessToken
/**
* constructor
*
* @param array $config
* @param array $config configuration array
* 'app_id' => YOUR_APPID, // string mandatory;
* 'secret' => YOUR_SECRET, // string mandatory;
*/
public function __construct(array $config)
{
Expand Down
6 changes: 4 additions & 2 deletions src/Wechat/Card.php
Original file line number Diff line number Diff line change
Expand Up @@ -80,11 +80,13 @@ class Card
/**
* constructor
*
* @param array $config
* @param array $config configuration array
* 'app_id' => YOUR_APPID, // string mandatory;
* 'secret' => YOUR_SECRET, // string mandatory;
*/
public function __construct(array $config)
{
$this->http = new Http(new AccessToken($config['app_id'], $config['secret']));
$this->http = new Http(new AccessToken($config));
$this->cache = new Cache($config['app_id']);
}

Expand Down
6 changes: 4 additions & 2 deletions src/Wechat/Color.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,13 @@ class Color
/**
* constructor
*
* @param array $config
* @param array $config configuration array
* 'app_id' => YOUR_APPID, // string mandatory;
* 'secret' => YOUR_SECRET, // string mandatory;
*/
public function __construct(array $config)
{
$this->http = new Http(new AccessToken($config['app_id'], $config['secret']));
$this->http = new Http(new AccessToken($config));
$this->cache = new Cache($config['app_id']);
}

Expand Down
6 changes: 4 additions & 2 deletions src/Wechat/Group.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,13 @@ class Group
/**
* constructor
*
* @param array $config
* @param array $config configuration array
* 'app_id' => YOUR_APPID, // string mandatory;
* 'secret' => YOUR_SECRET, // string mandatory;
*/
public function __construct(array $config)
{
$this->http = new Http(new AccessToken($config['app_id'], $config['secret']));
$this->http = new Http(new AccessToken($config));
}

/**
Expand Down
6 changes: 4 additions & 2 deletions src/Wechat/Image.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,13 @@ class Image
/**
* constructor
*
* @param array $config
* @param array $config configuration array
* 'app_id' => YOUR_APPID, // string mandatory;
* 'secret' => YOUR_SECRET, // string mandatory;
*/
public function __construct(array $config)
{
$this->http = new Http(new AccessToken($config['app_id'], $config['secret']));
$this->http = new Http(new AccessToken($config));
}

/**
Expand Down
2 changes: 1 addition & 1 deletion src/Wechat/Js.php
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ public function getTicket()
return $this->cache->get(
$key,
function ($key) use ($appId, $appSecret, $cache, $apiTicket) {
$http = new Http(new AccessToken($appId, $appSecret));
$http = new Http(new AccessToken(array('app_id' => $appId, 'secret' => $appSecret)));

$result = $http->get($apiTicket);

Expand Down
6 changes: 4 additions & 2 deletions src/Wechat/Media.php
Original file line number Diff line number Diff line change
Expand Up @@ -67,11 +67,13 @@ class Media
/**
* constructor
*
* @param array $config
* @param array $config configuration array
* 'app_id' => YOUR_APPID, // string mandatory;
* 'secret' => YOUR_SECRET, // string mandatory;
*/
public function __construct(array $config)
{
$this->http = new Http(new AccessToken($config['app_id'], $config['secret']));
$this->http = new Http(new AccessToken($config));
}

/**
Expand Down
6 changes: 4 additions & 2 deletions src/Wechat/Menu.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,13 @@ class Menu
/**
* constructor
*
* @param array $config
* @param array $config configuration array
* 'app_id' => YOUR_APPID, // string mandatory;
* 'secret' => YOUR_SECRET, // string mandatory;
*/
public function __construct(array $config)
{
$this->http = new Http(new AccessToken($config['app_id'], $config['secret']));
$this->http = new Http(new AccessToken($config));
}

/**
Expand Down
6 changes: 4 additions & 2 deletions src/Wechat/Notice.php
Original file line number Diff line number Diff line change
Expand Up @@ -140,11 +140,13 @@ class Notice
/**
* constructor
*
* @param array $config
* @param array $config configuration array
* 'app_id' => YOUR_APPID, // string mandatory;
* 'secret' => YOUR_SECRET, // string mandatory;
*/
public function __construct(array $config)
{
$this->http = new Http(new AccessToken($config['app_id'], $config['secret']));
$this->http = new Http(new AccessToken($config));
}

/**
Expand Down
6 changes: 4 additions & 2 deletions src/Wechat/QRCode.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,13 @@ class QRCode
/**
* constructor
*
* @param array $config
* @param array $config configuration array
* 'app_id' => YOUR_APPID, // string mandatory;
* 'secret' => YOUR_SECRET, // string mandatory;
*/
public function __construct(array $config)
{
$this->http = new Http(new AccessToken($config['app_id'], $config['secret']));
$this->http = new Http(new AccessToken($config));
}

/**
Expand Down
6 changes: 4 additions & 2 deletions src/Wechat/Semantic.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,12 +42,14 @@ class Semantic
/**
* constructor
*
* @param array $config
* @param array $config configuration array
* 'app_id' => YOUR_APPID, // string mandatory;
* 'secret' => YOUR_SECRET, // string mandatory;
*/
public function __construct(array $config)
{
$this->appId = $config['app_id'];
$this->http = new Http(new AccessToken($config['app_id'], $config['secret']));
$this->http = new Http(new AccessToken($config));
}

/**
Expand Down
4 changes: 3 additions & 1 deletion src/Wechat/Staff.php
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,9 @@ class Staff
/**
* constructor
*
* @param array $config
* @param array $config configuration array
* 'app_id' => YOUR_APPID, // string mandatory;
* 'secret' => YOUR_SECRET, // string mandatory;
*/
public function __construct(array $config)
{
Expand Down
6 changes: 4 additions & 2 deletions src/Wechat/Stats.php
Original file line number Diff line number Diff line change
Expand Up @@ -66,11 +66,13 @@ class Stats
/**
* constructor
*
* @param array $config
* @param array $config configuration array
* 'app_id' => YOUR_APPID, // string mandatory;
* 'secret' => YOUR_SECRET, // string mandatory;
*/
public function __construct(array $config)
{
$this->http = new Http(new AccessToken($config['app_id'], $config['secret']));
$this->http = new Http(new AccessToken($config));
}

/**
Expand Down
6 changes: 4 additions & 2 deletions src/Wechat/Store.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,13 @@ class Store
/**
* constructor
*
* @param array $config
* @param array $config configuration array
* 'app_id' => YOUR_APPID, // string mandatory;
* 'secret' => YOUR_SECRET, // string mandatory;
*/
public function __construct(array $config)
{
$this->http = new Http(new AccessToken($config['app_id'], $config['secret']));
$this->http = new Http(new AccessToken($config));
}

/**
Expand Down
6 changes: 4 additions & 2 deletions src/Wechat/Url.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,13 @@ class Url
/**
* constructor
*
* @param array $config
* @param array $config configuration array
* 'app_id' => YOUR_APPID, // string mandatory;
* 'secret' => YOUR_SECRET, // string mandatory;
*/
public function __construct(array $config)
{
$this->http = new Http(new AccessToken($config['app_id'], $config['secret']));
$this->http = new Http(new AccessToken($config));
}

/**
Expand Down
6 changes: 4 additions & 2 deletions src/Wechat/User.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,13 @@ class User
/**
* constructor
*
* @param array $config
* @param array $config configuration array
* 'app_id' => YOUR_APPID, // string mandatory;
* 'secret' => YOUR_SECRET, // string mandatory;
*/
public function __construct(array $config)
{
$this->http = new Http(new AccessToken($config['app_id'], $config['secret']));
$this->http = new Http(new AccessToken($config));
}

/**
Expand Down

0 comments on commit 43a6bac

Please sign in to comment.