Completed
Branch master (e6019f)
by i
31s
created
src/Alipay/AbstractAlipay.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -32,14 +32,14 @@  discard block
 block discarded – undo
32 32
     public function send(array $array, string $key) : Collection
33 33
     {
34 34
         $method = Arr::get($array, 'method');
35
-        $method = str_replace('.', '_', $method) . '_response';
35
+        $method = str_replace('.', '_', $method).'_response';
36 36
         $result = $this->post('', $array);
37 37
         $result = mb_convert_encoding($result, self::E_UTF8, self::E_GB2312);
38 38
         $result = json_decode($result, true);
39 39
 
40 40
         $data = Arr::get($result, $method);
41 41
         $sign = Arr::get($result, 'sign');
42
-        if (! self::verifySign($data, $key, true, $sign)) {
42
+        if (!self::verifySign($data, $key, true, $sign)) {
43 43
             throw new InvalidSignException(
44 44
                 'Invalid Alipay [signature] verify.',
45 45
                 3
@@ -105,15 +105,15 @@  discard block
 block discarded – undo
105 105
         $string = '';
106 106
         foreach ($array as $key => $val) {
107 107
             if ($isVerify && $key !== 'sign' && $key !== 'sign_type') {
108
-                $string .= $key . '=' . $val . '&';
108
+                $string .= $key.'='.$val.'&';
109 109
             }
110
-            if (! $isVerify
110
+            if (!$isVerify
111 111
                 && $val !== ''
112 112
                 && null !== $val
113 113
                 && $key !== 'sign'
114 114
                 && 0 !== strpos($val, '@')
115 115
             ) {
116
-                $string .= $key . '=' . $val . '&';
116
+                $string .= $key.'='.$val.'&';
117 117
             }
118 118
         }
119 119
 
@@ -181,7 +181,7 @@  discard block
 block discarded – undo
181 181
         $data = [];
182 182
         foreach ($array as $key => $val) {
183 183
             if (\is_array($val)) {
184
-                $data[$key] = self::toEncoding((array)$val, $to, $from);
184
+                $data[$key] = self::toEncoding((array) $val, $to, $from);
185 185
             } else {
186 186
                 $data[$key] = mb_convert_encoding($val, $to, $from);
187 187
             }
@@ -222,7 +222,7 @@  discard block
 block discarded – undo
222 222
     {
223 223
         $required = ['out_trade_no', 'total_amount', 'subject'];
224 224
         foreach ($required as $key => $item) {
225
-            if (! array_key_exists($item, $order)) {
225
+            if (!array_key_exists($item, $order)) {
226 226
                 throw new \InvalidArgumentException("The {$item} field is required");
227 227
             }
228 228
         }
Please login to merge, or discard this patch.
src/Alipay.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -93,7 +93,7 @@
 block discarded – undo
93 93
     public function pay(string $gateway, array $array = [])
94 94
     {
95 95
         $this->payload['biz_content'] = $array;
96
-        $class = \get_class($this) . '\\' . Str::studly($gateway) . 'Payment';
96
+        $class = \get_class($this).'\\'.Str::studly($gateway).'Payment';
97 97
 
98 98
         if (class_exists($class)) {
99 99
             return $this->toPay($class);
Please login to merge, or discard this patch.
src/Payment.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -42,7 +42,7 @@
 block discarded – undo
42 42
      */
43 43
     protected function create(string $method)
44 44
     {
45
-        $class = __NAMESPACE__ . '\\' . Str::studly($method);
45
+        $class = __NAMESPACE__.'\\'.Str::studly($method);
46 46
         if (class_exists($class)) {
47 47
             return $this->make($class);
48 48
         }
Please login to merge, or discard this patch.
src/Log.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -80,7 +80,7 @@
 block discarded – undo
80 80
     protected static function getLoggerInstance() : Logger
81 81
     {
82 82
         $maxFiles = 7;
83
-        $filename = sys_get_temp_dir() . '/logs/pay.log';
83
+        $filename = sys_get_temp_dir().'/logs/pay.log';
84 84
         $handler = new RotatingFileHandler($filename, $maxFiles);
85 85
         $handler->setFilenameFormat('{date}-{filename}', 'Y-m-d');
86 86
         $formatter = new LineFormatter(null, null, true, true);
Please login to merge, or discard this patch.
tests/PaymentTest.php 1 patch
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -25,7 +25,7 @@
 block discarded – undo
25 25
         ];
26 26
         $this->expectException(InvalidKeyException::class);
27 27
         Payment::alipay(['foo' => 'bar', 'env' => 'dev'])
28
-               ->web($order);
28
+                ->web($order);
29 29
     }
30 30
 
31 31
     public function testGatewayException()
Please login to merge, or discard this patch.