@@ -58,15 +58,15 @@ discard block |
||
58 | 58 | $string = ''; |
59 | 59 | foreach ($array as $key => $val) { |
60 | 60 | if ($isVerify && $key !== 'sign' && $key !== 'sign_type') { |
61 | - $string .= $key . '=' . $val . '&'; |
|
61 | + $string .= $key.'='.$val.'&'; |
|
62 | 62 | } |
63 | - if (! $isVerify |
|
63 | + if (!$isVerify |
|
64 | 64 | && $val !== '' |
65 | 65 | && null !== $val |
66 | 66 | && $key !== 'sign' |
67 | 67 | && 0 !== strpos($val, '@') |
68 | 68 | ) { |
69 | - $string .= $key . '=' . $val . '&'; |
|
69 | + $string .= $key.'='.$val.'&'; |
|
70 | 70 | } |
71 | 71 | } |
72 | 72 | |
@@ -134,7 +134,7 @@ discard block |
||
134 | 134 | $data = []; |
135 | 135 | foreach ($array as $key => $val) { |
136 | 136 | if (\is_array($val)) { |
137 | - $data[$key] = self::toEncoding((array)$val, $to, $from); |
|
137 | + $data[$key] = self::toEncoding((array) $val, $to, $from); |
|
138 | 138 | } else { |
139 | 139 | $data[$key] = mb_convert_encoding($val, $to, $from); |
140 | 140 | } |
@@ -27,7 +27,7 @@ |
||
27 | 27 | if (null === $returnUrl) { |
28 | 28 | $url = $object->url; |
29 | 29 | } else { |
30 | - $url = $object->url . '&redirect_url=' . urlencode($returnUrl); |
|
30 | + $url = $object->url.'&redirect_url='.urlencode($returnUrl); |
|
31 | 31 | } |
32 | 32 | echo $url; |
33 | 33 | } |
@@ -28,7 +28,7 @@ discard block |
||
28 | 28 | } |
29 | 29 | |
30 | 30 | ksort($array); |
31 | - $string = md5(self::getSignContent($array) . '&key=' . $key); |
|
31 | + $string = md5(self::getSignContent($array).'&key='.$key); |
|
32 | 32 | $string = strtoupper($string); |
33 | 33 | |
34 | 34 | return $string; |
@@ -45,8 +45,8 @@ discard block |
||
45 | 45 | { |
46 | 46 | $string = ''; |
47 | 47 | foreach ($array as $key => $val) { |
48 | - if ($key !== 'sign' && $val !== '' && ! \is_array($val)) { |
|
49 | - $string .= $key . '=' . $val; |
|
48 | + if ($key !== 'sign' && $val !== '' && !\is_array($val)) { |
|
49 | + $string .= $key.'='.$val; |
|
50 | 50 | } |
51 | 51 | } |
52 | 52 | |
@@ -114,7 +114,7 @@ discard block |
||
114 | 114 | $data = []; |
115 | 115 | foreach ($array as $key => $val) { |
116 | 116 | if (\is_array($val)) { |
117 | - $data[$key] = self::toEncoding((array)$val, $to, $from); |
|
117 | + $data[$key] = self::toEncoding((array) $val, $to, $from); |
|
118 | 118 | } else { |
119 | 119 | $data[$key] = mb_convert_encoding($val, $to, $from); |
120 | 120 | } |
@@ -47,7 +47,7 @@ |
||
47 | 47 | $env = $this->config->get('env', 'pro'); |
48 | 48 | $key = $this->config->get('key'); |
49 | 49 | $payload['sign'] = self::generateSign($payload, $key); |
50 | - $gateway = self::getGatewayUrl($env) . $gateway; |
|
50 | + $gateway = self::getGatewayUrl($env).$gateway; |
|
51 | 51 | |
52 | 52 | return $this->send($gateway, $payload, $key); |
53 | 53 | } |
@@ -86,7 +86,7 @@ |
||
86 | 86 | private function dispatcher(string $gateway, array $array = []) |
87 | 87 | { |
88 | 88 | $this->payload = array_merge($this->payload, $array); |
89 | - $class = \get_class($this) . '\\' . Str::studly($gateway) . 'Payment'; |
|
89 | + $class = \get_class($this).'\\'.Str::studly($gateway).'Payment'; |
|
90 | 90 | |
91 | 91 | if (class_exists($class)) { |
92 | 92 | return $this->toPay($class); |
@@ -37,7 +37,7 @@ discard block |
||
37 | 37 | |
38 | 38 | if ($code !== 'SUCCESS') { |
39 | 39 | throw new GatewayException( |
40 | - 'Wechat API Error: ' . $result['return_msg'], |
|
40 | + 'Wechat API Error: '.$result['return_msg'], |
|
41 | 41 | 20000 |
42 | 42 | ); |
43 | 43 | } |
@@ -142,7 +142,7 @@ discard block |
||
142 | 142 | */ |
143 | 143 | public static function fromXml(string $xml) : array |
144 | 144 | { |
145 | - if (! $xml) { |
|
145 | + if (!$xml) { |
|
146 | 146 | throw new \InvalidArgumentException('Invalid [xml] argument.', 3); |
147 | 147 | } |
148 | 148 | libxml_disable_entity_loader(true); |
@@ -39,7 +39,7 @@ |
||
39 | 39 | { |
40 | 40 | $required = ['out_trade_no', 'total_amount', 'subject']; |
41 | 41 | foreach ($required as $key => $item) { |
42 | - if (! array_key_exists($item, $order)) { |
|
42 | + if (!array_key_exists($item, $order)) { |
|
43 | 43 | throw new \InvalidArgumentException("The {$item} field is required."); |
44 | 44 | } |
45 | 45 | } |
@@ -80,7 +80,7 @@ |
||
80 | 80 | protected static function getLoggerInstance() : Logger |
81 | 81 | { |
82 | 82 | $maxFiles = 7; |
83 | - $filename = sys_get_temp_dir() . '/logs/payment.log'; |
|
83 | + $filename = sys_get_temp_dir().'/logs/payment.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); |
@@ -86,7 +86,7 @@ discard block |
||
86 | 86 | 'biz_content' => '', |
87 | 87 | ]; |
88 | 88 | |
89 | - ! $this->config->has('log.file') ?: $this->registerLogger(); |
|
89 | + !$this->config->has('log.file') ?: $this->registerLogger(); |
|
90 | 90 | } |
91 | 91 | |
92 | 92 | /** |
@@ -216,7 +216,7 @@ discard block |
||
216 | 216 | private function dispatcher(string $gateway, array $array = []) |
217 | 217 | { |
218 | 218 | $this->payload['biz_content'] = $array; |
219 | - $class = \get_class($this) . '\\' . Str::studly($gateway) . 'Payment'; |
|
219 | + $class = \get_class($this).'\\'.Str::studly($gateway).'Payment'; |
|
220 | 220 | |
221 | 221 | if (class_exists($class)) { |
222 | 222 | return $this->toPay($class); |
@@ -260,7 +260,7 @@ discard block |
||
260 | 260 | $this->payload, |
261 | 261 | $this->config->get('private_key') |
262 | 262 | ); |
263 | - Log::debug(ucfirst($type) . ' an order:', [ |
|
263 | + Log::debug(ucfirst($type).' an order:', [ |
|
264 | 264 | $this->gateway, |
265 | 265 | $this->payload, |
266 | 266 | ]); |