From 9b7afc6c833c121f28fcd998527ae80be08d4509 Mon Sep 17 00:00:00 2001 From: TheNorthMemory Date: Thu, 4 Jun 2015 11:15:43 +0800 Subject: [PATCH] docline comments & fix AccessToken parameter typos --- src/Wechat/AccessToken.php | 4 +++- src/Wechat/Card.php | 6 ++++-- src/Wechat/Color.php | 6 ++++-- src/Wechat/Group.php | 6 ++++-- src/Wechat/Image.php | 6 ++++-- src/Wechat/Js.php | 2 +- src/Wechat/Media.php | 6 ++++-- src/Wechat/Menu.php | 6 ++++-- src/Wechat/Notice.php | 6 ++++-- src/Wechat/QRCode.php | 6 ++++-- src/Wechat/Semantic.php | 6 ++++-- src/Wechat/Staff.php | 4 +++- src/Wechat/Stats.php | 6 ++++-- src/Wechat/Store.php | 6 ++++-- src/Wechat/Url.php | 6 ++++-- src/Wechat/User.php | 6 ++++-- 16 files changed, 59 insertions(+), 29 deletions(-) diff --git a/src/Wechat/AccessToken.php b/src/Wechat/AccessToken.php index 126196d27..4feb7ae00 100644 --- a/src/Wechat/AccessToken.php +++ b/src/Wechat/AccessToken.php @@ -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) { diff --git a/src/Wechat/Card.php b/src/Wechat/Card.php index d54c8ef31..e11f06ecc 100644 --- a/src/Wechat/Card.php +++ b/src/Wechat/Card.php @@ -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']); } diff --git a/src/Wechat/Color.php b/src/Wechat/Color.php index a29bd5e41..717f122d8 100644 --- a/src/Wechat/Color.php +++ b/src/Wechat/Color.php @@ -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']); } diff --git a/src/Wechat/Group.php b/src/Wechat/Group.php index eba73538c..a3326e61c 100644 --- a/src/Wechat/Group.php +++ b/src/Wechat/Group.php @@ -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)); } /** diff --git a/src/Wechat/Image.php b/src/Wechat/Image.php index 179b06571..cf1828219 100644 --- a/src/Wechat/Image.php +++ b/src/Wechat/Image.php @@ -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)); } /** diff --git a/src/Wechat/Js.php b/src/Wechat/Js.php index 264147dd1..326c45ac0 100644 --- a/src/Wechat/Js.php +++ b/src/Wechat/Js.php @@ -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); diff --git a/src/Wechat/Media.php b/src/Wechat/Media.php index 4f5cc7f2c..12d939df5 100644 --- a/src/Wechat/Media.php +++ b/src/Wechat/Media.php @@ -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)); } /** diff --git a/src/Wechat/Menu.php b/src/Wechat/Menu.php index aa61f0f3f..25facc5a8 100644 --- a/src/Wechat/Menu.php +++ b/src/Wechat/Menu.php @@ -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)); } /** diff --git a/src/Wechat/Notice.php b/src/Wechat/Notice.php index 23c0dad18..a88ba9fba 100644 --- a/src/Wechat/Notice.php +++ b/src/Wechat/Notice.php @@ -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)); } /** diff --git a/src/Wechat/QRCode.php b/src/Wechat/QRCode.php index d365cc08c..6f3b4bbf0 100644 --- a/src/Wechat/QRCode.php +++ b/src/Wechat/QRCode.php @@ -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)); } /** diff --git a/src/Wechat/Semantic.php b/src/Wechat/Semantic.php index 69c26a072..22d01fd25 100644 --- a/src/Wechat/Semantic.php +++ b/src/Wechat/Semantic.php @@ -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)); } /** diff --git a/src/Wechat/Staff.php b/src/Wechat/Staff.php index 94406975d..a240cc84c 100644 --- a/src/Wechat/Staff.php +++ b/src/Wechat/Staff.php @@ -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) { diff --git a/src/Wechat/Stats.php b/src/Wechat/Stats.php index 9bd0d9def..91a626698 100644 --- a/src/Wechat/Stats.php +++ b/src/Wechat/Stats.php @@ -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)); } /** diff --git a/src/Wechat/Store.php b/src/Wechat/Store.php index d13886ce3..d2e35f31b 100644 --- a/src/Wechat/Store.php +++ b/src/Wechat/Store.php @@ -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)); } /** diff --git a/src/Wechat/Url.php b/src/Wechat/Url.php index 5b89428b6..bf941b034 100644 --- a/src/Wechat/Url.php +++ b/src/Wechat/Url.php @@ -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)); } /** diff --git a/src/Wechat/User.php b/src/Wechat/User.php index 587534d18..c2cacf64d 100644 --- a/src/Wechat/User.php +++ b/src/Wechat/User.php @@ -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)); } /**