@@ -98,7 +98,7 @@ |
||
| 98 | 98 | $articles = [$articles]; |
| 99 | 99 | } |
| 100 | 100 | |
| 101 | - $params = ['articles' => array_map(function ($article) { |
|
| 101 | + $params = ['articles' => array_map(function($article) { |
|
| 102 | 102 | if ($article instanceof Article) { |
| 103 | 103 | return $article->only([ |
| 104 | 104 | 'title', 'thumb_media_id', 'author', 'digest', |
@@ -44,17 +44,17 @@ discard block |
||
| 44 | 44 | const API_DELETE_CARD = 'https://qyapi.weixin.qq.com/cgi-bin/card/delete'; |
| 45 | 45 | |
| 46 | 46 | // 卡券类型 |
| 47 | - const TYPE_GENERAL_COUPON = 'GENERAL_COUPON'; // 通用券 |
|
| 48 | - const TYPE_GROUPON = 'GROUPON'; // 团购券 |
|
| 49 | - const TYPE_DISCOUNT = 'DISCOUNT'; // 折扣券 |
|
| 50 | - const TYPE_GIFT = 'GIFT'; // 礼品券 |
|
| 51 | - const TYPE_CASH = 'CASH'; // 代金券 |
|
| 47 | + const TYPE_GENERAL_COUPON = 'GENERAL_COUPON'; // 通用券 |
|
| 48 | + const TYPE_GROUPON = 'GROUPON'; // 团购券 |
|
| 49 | + const TYPE_DISCOUNT = 'DISCOUNT'; // 折扣券 |
|
| 50 | + const TYPE_GIFT = 'GIFT'; // 礼品券 |
|
| 51 | + const TYPE_CASH = 'CASH'; // 代金券 |
|
| 52 | 52 | |
| 53 | 53 | // 卡券状态 |
| 54 | - const CARD_STATUS_NOT_VERIFY = 'CARD_STATUS_NOT_VERIFY'; // 待审核 |
|
| 55 | - const CARD_STATUS_VERIFY_FAIL = 'CARD_STATUS_VERIFY_FAIL'; // 审核失败 |
|
| 56 | - const CARD_STATUS_VERIFY_OK = 'CARD_STATUS_VERIFY_OK'; // 通过审核 |
|
| 57 | - const CARD_STATUS_USER_DELETE = 'CARD_STATUS_USER_DELETE'; // 卡券被商户删除 |
|
| 54 | + const CARD_STATUS_NOT_VERIFY = 'CARD_STATUS_NOT_VERIFY'; // 待审核 |
|
| 55 | + const CARD_STATUS_VERIFY_FAIL = 'CARD_STATUS_VERIFY_FAIL'; // 审核失败 |
|
| 56 | + const CARD_STATUS_VERIFY_OK = 'CARD_STATUS_VERIFY_OK'; // 通过审核 |
|
| 57 | + const CARD_STATUS_USER_DELETE = 'CARD_STATUS_USER_DELETE'; // 卡券被商户删除 |
|
| 58 | 58 | const CARD_STATUS_USER_DISPATCH = 'CARD_STATUS_USER_DISPATCH'; // 在公众平台投放过的卡券 |
| 59 | 59 | |
| 60 | 60 | /** |
@@ -163,7 +163,7 @@ discard block |
||
| 163 | 163 | */ |
| 164 | 164 | public function jsConfigForAssign(array $cards) |
| 165 | 165 | { |
| 166 | - return json_encode(array_map(function ($card) { |
|
| 166 | + return json_encode(array_map(function($card) { |
|
| 167 | 167 | return $this->attachExtension($card['card_id'], $card); |
| 168 | 168 | }, $cards)); |
| 169 | 169 | } |
@@ -367,7 +367,7 @@ |
||
| 367 | 367 | /** |
| 368 | 368 | * Put state to session storage and return it. |
| 369 | 369 | * |
| 370 | - * @return string|bool |
|
| 370 | + * @return false|string |
|
| 371 | 371 | */ |
| 372 | 372 | protected function makeState() |
| 373 | 373 | { |
@@ -23,7 +23,6 @@ |
||
| 23 | 23 | /** |
| 24 | 24 | * Create an instance of the EntWeChat for the given authorizer. |
| 25 | 25 | * |
| 26 | - * @param string $corpId Authorizer CorpId |
|
| 27 | 26 | * @param string $permanentCode Authorizer permanent-code |
| 28 | 27 | * |
| 29 | 28 | * @return \EntWeChat\Foundation\Application |
@@ -31,8 +31,8 @@ |
||
| 31 | 31 | public function createAuthorizerApplication($authorizerCorpId, $permanentCode) |
| 32 | 32 | { |
| 33 | 33 | $this->fetch('authorization') |
| 34 | - ->setAuthorizerCorpId($authorizerCorpId) |
|
| 35 | - ->setAuthorizerPermanentCode($permanentCode); |
|
| 34 | + ->setAuthorizerCorpId($authorizerCorpId) |
|
| 35 | + ->setAuthorizerPermanentCode($permanentCode); |
|
| 36 | 36 | |
| 37 | 37 | $application = $this->fetch('app'); |
| 38 | 38 | $application['access_token'] = $this->fetch('authorizer_access_token'); |
@@ -22,7 +22,7 @@ discard block |
||
| 22 | 22 | * @param int|null $order |
| 23 | 23 | * @param int|null $partyId |
| 24 | 24 | * |
| 25 | - * @return int |
|
| 25 | + * @return \EntWeChat\Support\Collection |
|
| 26 | 26 | */ |
| 27 | 27 | public function create($name, $parentId, $order = null, $partyId = null) |
| 28 | 28 | { |
@@ -39,7 +39,7 @@ discard block |
||
| 39 | 39 | /** |
| 40 | 40 | * List all Departments. |
| 41 | 41 | * |
| 42 | - * @return array |
|
| 42 | + * @return \EntWeChat\Support\Collection |
|
| 43 | 43 | */ |
| 44 | 44 | public function lists($partyId = null) |
| 45 | 45 | { |
@@ -54,9 +54,8 @@ discard block |
||
| 54 | 54 | * Update a Department. |
| 55 | 55 | * |
| 56 | 56 | * @param int $partyId |
| 57 | - * @param array $name |
|
| 58 | 57 | * |
| 59 | - * @return bool |
|
| 58 | + * @return \EntWeChat\Support\Collection |
|
| 60 | 59 | */ |
| 61 | 60 | public function update($partyId, array $partyInfo = []) |
| 62 | 61 | { |
@@ -68,9 +67,8 @@ discard block |
||
| 68 | 67 | /** |
| 69 | 68 | * Delete Department. |
| 70 | 69 | * |
| 71 | - * @param int $groupId |
|
| 72 | 70 | * |
| 73 | - * @return bool |
|
| 71 | + * @return \EntWeChat\Support\Collection |
|
| 74 | 72 | */ |
| 75 | 73 | public function delete($partyId) |
| 76 | 74 | { |
@@ -20,8 +20,8 @@ |
||
| 20 | 20 | |
| 21 | 21 | $protocol = (!empty($_SERVER['HTTPS']) |
| 22 | 22 | && $_SERVER['HTTPS'] !== 'off' |
| 23 | - || (int)$_SERVER['SERVER_PORT'] === 443) ? 'https://' : 'http://'; |
|
| 23 | + || (int) $_SERVER['SERVER_PORT'] === 443) ? 'https://' : 'http://'; |
|
| 24 | 24 | |
| 25 | - return $protocol . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']; |
|
| 25 | + return $protocol.$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI']; |
|
| 26 | 26 | } |
| 27 | 27 | } |
@@ -57,7 +57,7 @@ |
||
| 57 | 57 | { |
| 58 | 58 | $className = basename(str_replace('\\', '/', static::class)); |
| 59 | 59 | |
| 60 | - $name = Str::snake($className) . '.' . $key; |
|
| 60 | + $name = Str::snake($className).'.'.$key; |
|
| 61 | 61 | |
| 62 | 62 | return $this->container->offsetGet($name); |
| 63 | 63 | } |
@@ -76,9 +76,9 @@ discard block |
||
| 76 | 76 | |
| 77 | 77 | foreach ($array as $key => $value) { |
| 78 | 78 | if (is_array($value)) { |
| 79 | - $results = array_merge($results, static::dot($value, $prepend . $key . '.')); |
|
| 79 | + $results = array_merge($results, static::dot($value, $prepend.$key.'.')); |
|
| 80 | 80 | } else { |
| 81 | - $results[$prepend . $key] = $value; |
|
| 81 | + $results[$prepend.$key] = $value; |
|
| 82 | 82 | } |
| 83 | 83 | } |
| 84 | 84 | |
@@ -95,7 +95,7 @@ discard block |
||
| 95 | 95 | */ |
| 96 | 96 | public static function except($array, $keys) |
| 97 | 97 | { |
| 98 | - return array_diff_key($array, array_flip((array)$keys)); |
|
| 98 | + return array_diff_key($array, array_flip((array) $keys)); |
|
| 99 | 99 | } |
| 100 | 100 | |
| 101 | 101 | /** |
@@ -113,7 +113,7 @@ discard block |
||
| 113 | 113 | foreach (explode('.', $key) as $segment) { |
| 114 | 114 | $results = []; |
| 115 | 115 | foreach ($array as $value) { |
| 116 | - $value = (array)$value; |
|
| 116 | + $value = (array) $value; |
|
| 117 | 117 | $results[] = $value[$segment]; |
| 118 | 118 | } |
| 119 | 119 | $array = array_values($results); |
@@ -168,7 +168,7 @@ discard block |
||
| 168 | 168 | $return = []; |
| 169 | 169 | array_walk_recursive( |
| 170 | 170 | $array, |
| 171 | - function ($x) use (&$return) { |
|
| 171 | + function($x) use (&$return) { |
|
| 172 | 172 | $return[] = $x; |
| 173 | 173 | } |
| 174 | 174 | ); |
@@ -186,7 +186,7 @@ discard block |
||
| 186 | 186 | { |
| 187 | 187 | $original = &$array; |
| 188 | 188 | |
| 189 | - foreach ((array)$keys as $key) { |
|
| 189 | + foreach ((array) $keys as $key) { |
|
| 190 | 190 | $parts = explode('.', $key); |
| 191 | 191 | while (count($parts) > 1) { |
| 192 | 192 | $part = array_shift($parts); |
@@ -239,7 +239,7 @@ discard block |
||
| 239 | 239 | */ |
| 240 | 240 | public static function only($array, $keys) |
| 241 | 241 | { |
| 242 | - return array_intersect_key($array, array_flip((array)$keys)); |
|
| 242 | + return array_intersect_key($array, array_flip((array) $keys)); |
|
| 243 | 243 | } |
| 244 | 244 | |
| 245 | 245 | /** |
@@ -142,14 +142,14 @@ |
||
| 142 | 142 | */ |
| 143 | 143 | public static function snake($value, $delimiter = '_') |
| 144 | 144 | { |
| 145 | - $key = $value . $delimiter; |
|
| 145 | + $key = $value.$delimiter; |
|
| 146 | 146 | |
| 147 | 147 | if (isset(static::$snakeCache[$key])) { |
| 148 | 148 | return static::$snakeCache[$key]; |
| 149 | 149 | } |
| 150 | 150 | |
| 151 | 151 | if (!ctype_lower($value)) { |
| 152 | - $value = strtolower(preg_replace('/(.)(?=[A-Z])/', '$1' . $delimiter, $value)); |
|
| 152 | + $value = strtolower(preg_replace('/(.)(?=[A-Z])/', '$1'.$delimiter, $value)); |
|
| 153 | 153 | } |
| 154 | 154 | |
| 155 | 155 | return static::$snakeCache[$key] = $value; |