Completed
Branch master (8d88b0)
by Songda
01:28
created
src/Contracts/GatewayInterface.php 1 patch
Doc Comments   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -28,7 +28,7 @@  discard block
 block discarded – undo
28 28
      * 
29 29
      * @param   array      $config_biz [description]
30 30
      * 
31
-     * @return  [type]                 [description]
31
+     * @return  boolean|null                 [description]
32 32
      */
33 33
     public function refund(array $config_biz);
34 34
 
@@ -41,7 +41,7 @@  discard block
 block discarded – undo
41 41
      * 
42 42
      * @param   array      $config_biz [description]
43 43
      * 
44
-     * @return  [type]                 [description]
44
+     * @return  boolean|null                 [description]
45 45
      */
46 46
     public function close(array $config_biz);
47 47
 
@@ -56,7 +56,7 @@  discard block
 block discarded – undo
56 56
      * @param   string     $sign 签名字符串-支付宝服务器发送过来的原始串
57 57
      * @param   bool       $sync 是否同步验证
58 58
      * 
59
-     * @return  [type]           [description]
59
+     * @return  boolean           [description]
60 60
      */
61 61
     public function verify($data, $sign = null, $sync = false);
62 62
 }
Please login to merge, or discard this patch.
src/Exceptions/GatewayException.php 1 patch
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -21,7 +21,7 @@
 block discarded – undo
21 21
      *
22 22
      * @version 2017-07-28
23 23
      *
24
-     * @param   [type]     $message [description]
24
+     * @param   string     $message [description]
25 25
      * @param   [type]     $code    [description]
26 26
      */
27 27
     public function __construct($message, $code, $raw = [])
Please login to merge, or discard this patch.
src/Gateways/Alipay/Alipay.php 2 patches
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -216,7 +216,7 @@
 block discarded – undo
216 216
      *
217 217
      * @version 2017-08-12
218 218
      *
219
-     * @param   [type]     $method [description]
219
+     * @param   string     $method [description]
220 220
      *
221 221
      * @return  [type]             [description]
222 222
      */
Please login to merge, or discard this patch.
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -198,13 +198,13 @@  discard block
 block discarded – undo
198 198
      */
199 199
     protected function buildPayHtml()
200 200
     {
201
-        $sHtml = "<form id='alipaysubmit' name='alipaysubmit' action='".$this->gateway."?charset=utf-8' method='POST'>";
202
-        while (list ($key, $val) = each ($this->config)) {
203
-            $val = str_replace("'","&apos;",$val);
204
-            $sHtml.= "<input type='hidden' name='".$key."' value='".$val."'/>";
201
+        $sHtml = "<form id='alipaysubmit' name='alipaysubmit' action='" . $this->gateway . "?charset=utf-8' method='POST'>";
202
+        while (list ($key, $val) = each($this->config)) {
203
+            $val = str_replace("'", "&apos;", $val);
204
+            $sHtml .= "<input type='hidden' name='" . $key . "' value='" . $val . "'/>";
205 205
         }
206
-        $sHtml = $sHtml."<input type='submit' value='ok' style='display:none;''></form>";
207
-        $sHtml = $sHtml."<script>document.forms['alipaysubmit'].submit();</script>";
206
+        $sHtml = $sHtml . "<input type='submit' value='ok' style='display:none;''></form>";
207
+        $sHtml = $sHtml . "<script>document.forms['alipaysubmit'].submit();</script>";
208 208
         
209 209
         return $sHtml;
210 210
     }
@@ -224,7 +224,7 @@  discard block
 block discarded – undo
224 224
     {
225 225
         $data = json_decode($this->post($this->gateway, $this->config), true);
226 226
 
227
-        if (! isset($data[$method]['code']) || $data[$method]['code'] !== '10000') {
227
+        if (!isset($data[$method]['code']) || $data[$method]['code'] !== '10000') {
228 228
             throw new GatewayException(
229 229
                 'get result error:' . $data[$method]['msg'] . ' - ' . $data[$method]['sub_msg'],
230 230
                 $data[$method]['code'],
Please login to merge, or discard this patch.
src/Gateways/Wechat/Wechat.php 3 patches
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -66,7 +66,7 @@
 block discarded – undo
66 66
      *
67 67
      * @version 2017-08-15
68 68
      *
69
-     * @param   array      $cofnig_biz [description]
69
+     * @param   array      $config_biz [description]
70 70
      *
71 71
      * @return  [type]                 [description]
72 72
      */
Please login to merge, or discard this patch.
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -193,7 +193,7 @@  discard block
 block discarded – undo
193 193
 
194 194
         foreach ($data as $k => $v)
195 195
         {
196
-            if($k != "sign" && $v != "" && !is_array($v)){
196
+            if ($k != "sign" && $v != "" && !is_array($v)) {
197 197
                 $buff .= $k . "=" . $v . "&";
198 198
             }
199 199
         }
@@ -235,19 +235,19 @@  discard block
 block discarded – undo
235 235
      */
236 236
     protected function toXml($data)
237 237
     {
238
-        if(!is_array($data) || count($data) <= 0){
238
+        if (!is_array($data) || count($data) <= 0) {
239 239
             throw new InvalidArgumentException("convert to xml error!invalid array!");
240 240
         }
241 241
         
242 242
         $xml = "<xml>";
243
-        foreach ($data as $key => $val){
244
-            if (is_numeric($val)){
245
-                $xml.="<".$key.">".$val."</".$key.">";
246
-            }else{
247
-                $xml.="<".$key."><![CDATA[".$val."]]></".$key.">";
243
+        foreach ($data as $key => $val) {
244
+            if (is_numeric($val)) {
245
+                $xml .= "<" . $key . ">" . $val . "</" . $key . ">";
246
+            }else {
247
+                $xml .= "<" . $key . "><![CDATA[" . $val . "]]></" . $key . ">";
248 248
             }
249 249
         }
250
-        $xml.="</xml>";
250
+        $xml .= "</xml>";
251 251
 
252 252
         return $xml; 
253 253
     }
@@ -265,7 +265,7 @@  discard block
 block discarded – undo
265 265
      */
266 266
     protected function fromXml($xml)
267 267
     {   
268
-        if(!$xml){
268
+        if (!$xml) {
269 269
             throw new InvalidArgumentException("convert to array error !invalid xml");
270 270
         }
271 271
 
Please login to merge, or discard this patch.
Braces   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -243,7 +243,7 @@
 block discarded – undo
243 243
         foreach ($data as $key => $val){
244 244
             if (is_numeric($val)){
245 245
                 $xml.="<".$key.">".$val."</".$key.">";
246
-            }else{
246
+            } else{
247 247
                 $xml.="<".$key."><![CDATA[".$val."]]></".$key.">";
248 248
             }
249 249
         }
Please login to merge, or discard this patch.
src/Pay.php 2 patches
Doc Comments   +2 added lines, -3 removed lines patch added patch discarded remove patch
@@ -96,7 +96,7 @@  discard block
 block discarded – undo
96 96
      * 
97 97
      * @version 2017-08-10
98 98
      * 
99
-     * @param   [type]     $gateway [description]
99
+     * @param   string     $gateway [description]
100 100
      * 
101 101
      * @return  [type]              [description]
102 102
      */
@@ -118,9 +118,8 @@  discard block
 block discarded – undo
118 118
      * 
119 119
      * @version 2017-07-30
120 120
      * 
121
-     * @param   [type]     $driver  [description]
122
-     * @param   [type]     $config  [description]
123 121
      * 
122
+     * @param string $gateway
124 123
      * @return  [type]              [description]
125 124
      */
126 125
     private function build($gateway)
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -80,7 +80,7 @@  discard block
 block discarded – undo
80 80
      */
81 81
     public function gateway($gateway = 'web')
82 82
     {
83
-        if (! isset($this->drivers)) {
83
+        if (!isset($this->drivers)) {
84 84
             throw new InvalidArgumentException("Driver is not defined.");
85 85
         }
86 86
 
@@ -102,7 +102,7 @@  discard block
 block discarded – undo
102 102
      */
103 103
     private function createGateway($gateway)
104 104
     {
105
-        if (! file_exists(__DIR__ . '/Gateways/' . ucfirst($this->drivers) . '/' . ucfirst($gateway) . 'Gateway.php')) {
105
+        if (!file_exists(__DIR__ . '/Gateways/' . ucfirst($this->drivers) . '/' . ucfirst($gateway) . 'Gateway.php')) {
106 106
             throw new InvalidArgumentException("Gateway [$gateway] is not supported.");
107 107
         }
108 108
 
Please login to merge, or discard this patch.
src/Support/Config.php 1 patch
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -33,7 +33,7 @@
 block discarded – undo
33 33
      * @version 2017-07-28
34 34
      *
35 35
      * @param   [type]     $key     [description]
36
-     * @param   [type]     $default [description]
36
+     * @param   string     $default [description]
37 37
      *
38 38
      * @return  [type]              [description]
39 39
      */
Please login to merge, or discard this patch.
src/Traits/HasHttpRequest.php 1 patch
Doc Comments   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -28,7 +28,7 @@  discard block
 block discarded – undo
28 28
      * @param array  $query
29 29
      * @param array  $headers
30 30
      *
31
-     * @return array
31
+     * @return string
32 32
      */
33 33
     protected function get($endpoint, $query = [], $headers = [])
34 34
     {
@@ -45,7 +45,7 @@  discard block
 block discarded – undo
45 45
      * @param array  $params
46 46
      * @param array  $headers
47 47
      *
48
-     * @return array
48
+     * @return string
49 49
      */
50 50
     protected function post($endpoint, $params = [], $headers = [])
51 51
     {
Please login to merge, or discard this patch.
src/Gateways/Wechat/WapGateway.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -38,7 +38,7 @@
 block discarded – undo
38 38
 
39 39
         $data = $this->preOrder();
40 40
 
41
-        return is_null($this->user_config->get('return_url')) ? $data['MWEB_URL'] : $data['MWEB_URL'].
42
-                        '&redirect_url='. urlencode($this->config['return_url']);
41
+        return is_null($this->user_config->get('return_url')) ? $data['MWEB_URL'] : $data['MWEB_URL'] .
42
+                        '&redirect_url=' . urlencode($this->config['return_url']);
43 43
     }
44 44
 }
Please login to merge, or discard this patch.