@@ -59,7 +59,7 @@ discard block |
||
| 59 | 59 | |
| 60 | 60 | public function set_format($format) |
| 61 | 61 | { |
| 62 | - if (! in_array($format, YZApiProtocol::allowed_format())) { |
|
| 62 | + if (!in_array($format, YZApiProtocol::allowed_format())) { |
|
| 63 | 63 | throw new Exception('设置的数据格式错误'); |
| 64 | 64 | } |
| 65 | 65 | $this->format = $format; |
@@ -69,7 +69,7 @@ discard block |
||
| 69 | 69 | |
| 70 | 70 | public function set_sign_method($method) |
| 71 | 71 | { |
| 72 | - if (! in_array($method, YZApiProtocol::allowed_sign_methods())) { |
|
| 72 | + if (!in_array($method, YZApiProtocol::allowed_sign_methods())) { |
|
| 73 | 73 | throw new Exception('设置的签名方法错误'); |
| 74 | 74 | } |
| 75 | 75 | $this->sign_method = $method; |
@@ -89,7 +89,7 @@ discard block |
||
| 89 | 89 | |
| 90 | 90 | private function build_request_params($method, $api_params) |
| 91 | 91 | { |
| 92 | - if (! is_array($api_params)) { |
|
| 92 | + if (!is_array($api_params)) { |
|
| 93 | 93 | $api_params = []; |
| 94 | 94 | } |
| 95 | 95 | if ($this->app_id) { |
@@ -25,7 +25,7 @@ discard block |
||
| 25 | 25 | public static function post($url, $params, $files = []) |
| 26 | 26 | { |
| 27 | 27 | $headers = []; |
| 28 | - if (! $files) { |
|
| 28 | + if (!$files) { |
|
| 29 | 29 | $body = http_build_query($params); |
| 30 | 30 | } else { |
| 31 | 31 | $body = self::build_http_query_multi($params, $files); |
@@ -52,7 +52,7 @@ discard block |
||
| 52 | 52 | switch ($method) { |
| 53 | 53 | case 'POST': |
| 54 | 54 | curl_setopt($ci, CURLOPT_POST, true); |
| 55 | - if (! empty($postfields)) { |
|
| 55 | + if (!empty($postfields)) { |
|
| 56 | 56 | curl_setopt($ci, CURLOPT_POSTFIELDS, $postfields); |
| 57 | 57 | } |
| 58 | 58 | break; |
@@ -73,7 +73,7 @@ discard block |
||
| 73 | 73 | |
| 74 | 74 | private static function build_http_query_multi($params, $files) |
| 75 | 75 | { |
| 76 | - if (! $params) { |
|
| 76 | + if (!$params) { |
|
| 77 | 77 | return ''; |
| 78 | 78 | } |
| 79 | 79 | |
@@ -90,7 +90,7 @@ discard block |
||
| 90 | 90 | $multipartbody .= $value."\r\n"; |
| 91 | 91 | } |
| 92 | 92 | foreach ($files as $key => $value) { |
| 93 | - if (! $value) { |
|
| 93 | + if (!$value) { |
|
| 94 | 94 | continue; |
| 95 | 95 | } |
| 96 | 96 | |
@@ -62,7 +62,7 @@ |
||
| 62 | 62 | |
| 63 | 63 | private function build_request_params($method, $api_params) |
| 64 | 64 | { |
| 65 | - if (! is_array($api_params)) { |
|
| 65 | + if (!is_array($api_params)) { |
|
| 66 | 66 | $api_params = []; |
| 67 | 67 | } |
| 68 | 68 | $pairs = $this->get_common_params($this->access_token, $method); |
@@ -37,7 +37,7 @@ |
||
| 37 | 37 | |
| 38 | 38 | public static function sign($appSecret, $params, $method = 'md5') |
| 39 | 39 | { |
| 40 | - if (! is_array($params)) { |
|
| 40 | + if (!is_array($params)) { |
|
| 41 | 41 | $params = []; |
| 42 | 42 | } |
| 43 | 43 | |
@@ -64,7 +64,7 @@ discard block |
||
| 64 | 64 | ]; |
| 65 | 65 | $response = $client->post('youzan.trades.qr.get', self::VERSION, $params); |
| 66 | 66 | $response = $response['response']; |
| 67 | - if (! $response['qr_trades']) { |
|
| 67 | + if (!$response['qr_trades']) { |
|
| 68 | 68 | return new PaymentStatus(); |
| 69 | 69 | } |
| 70 | 70 | |
@@ -110,7 +110,7 @@ discard block |
||
| 110 | 110 | { |
| 111 | 111 | $self = $this; |
| 112 | 112 | |
| 113 | - return Cache::remember('payment:youzan:token', 360, function () use ($self) { |
|
| 113 | + return Cache::remember('payment:youzan:token', 360, function() use ($self) { |
|
| 114 | 114 | return $self->getToken(); |
| 115 | 115 | }); |
| 116 | 116 | } |
@@ -51,8 +51,8 @@ discard block |
||
| 51 | 51 | protected function mapWebRoutes() |
| 52 | 52 | { |
| 53 | 53 | Route::middleware(['web', 'user.share']) |
| 54 | - ->namespace($this->namespace) |
|
| 55 | - ->group(base_path('routes/web.php')); |
|
| 54 | + ->namespace($this->namespace) |
|
| 55 | + ->group(base_path('routes/web.php')); |
|
| 56 | 56 | } |
| 57 | 57 | |
| 58 | 58 | /** |
@@ -63,8 +63,8 @@ discard block |
||
| 63 | 63 | protected function mapApiRoutes() |
| 64 | 64 | { |
| 65 | 65 | Route::prefix('api') |
| 66 | - ->middleware('api') |
|
| 67 | - ->namespace($this->namespace) |
|
| 68 | - ->group(base_path('routes/api.php')); |
|
| 66 | + ->middleware('api') |
|
| 67 | + ->namespace($this->namespace) |
|
| 68 | + ->group(base_path('routes/api.php')); |
|
| 69 | 69 | } |
| 70 | 70 | } |
@@ -156,7 +156,7 @@ discard block |
||
| 156 | 156 | */ |
| 157 | 157 | public function joinACourse(Course $course) |
| 158 | 158 | { |
| 159 | - if (! $this->joinCourses()->whereId($course->id)->exists()) { |
|
| 159 | + if (!$this->joinCourses()->whereId($course->id)->exists()) { |
|
| 160 | 160 | $this->joinCourses()->attach($course->id, [ |
| 161 | 161 | 'created_at' => Carbon::now()->format('Y-m-d H:i:s'), |
| 162 | 162 | 'charge' => $course->charge, |
@@ -171,7 +171,7 @@ discard block |
||
| 171 | 171 | */ |
| 172 | 172 | public function buyAVideo(Video $video) |
| 173 | 173 | { |
| 174 | - if (! $this->buyVideos()->whereId($video->id)->exists()) { |
|
| 174 | + if (!$this->buyVideos()->whereId($video->id)->exists()) { |
|
| 175 | 175 | $this->buyVideos()->attach($video->id, [ |
| 176 | 176 | 'created_at' => Carbon::now()->format('Y-m-d H:i:s'), |
| 177 | 177 | 'charge' => $video->charge, |
@@ -33,7 +33,7 @@ |
||
| 33 | 33 | public function handle(PaymentSuccessEvent $event) |
| 34 | 34 | { |
| 35 | 35 | $payment = $event->payment; |
| 36 | - if (! $payment) { |
|
| 36 | + if (!$payment) { |
|
| 37 | 37 | return; |
| 38 | 38 | } |
| 39 | 39 | |
@@ -43,7 +43,7 @@ |
||
| 43 | 43 | return; |
| 44 | 44 | } |
| 45 | 45 | |
| 46 | - if (! $toUser) { |
|
| 46 | + if (!$toUser) { |
|
| 47 | 47 | Log::error('AtEvent'.$toUserNickName); |
| 48 | 48 | |
| 49 | 49 | return; |