@@ -96,7 +96,7 @@ discard block |
||
| 96 | 96 | return $this->getTranslatedTextFromResponse($translateResponse); |
| 97 | 97 | } |
| 98 | 98 | |
| 99 | - throw new TranslationErrorException('Translate error, error_code : '.$translateResponse['errorCode'].'. Refer url: http://fanyi.youdao.com/openapi?path=data-mode'); |
|
| 99 | + throw new TranslationErrorException('Translate error, error_code : ' . $translateResponse['errorCode'] . '. Refer url: http://fanyi.youdao.com/openapi?path=data-mode'); |
|
| 100 | 100 | } |
| 101 | 101 | |
| 102 | 102 | /** |
@@ -118,7 +118,7 @@ discard block |
||
| 118 | 118 | { |
| 119 | 119 | $query = http_build_query($this->config); |
| 120 | 120 | |
| 121 | - return $this->api.$query.'&q='.urlencode($text); |
|
| 121 | + return $this->api . $query . '&q=' . urlencode($text); |
|
| 122 | 122 | } |
| 123 | 123 | |
| 124 | 124 | /** |
@@ -136,7 +136,7 @@ discard block |
||
| 136 | 136 | |
| 137 | 137 | $query = http_build_query(['salt' => $salt, 'sign' => $sign, 'appKey' => $key]); |
| 138 | 138 | |
| 139 | - return $this->api_v2.$query.'&q='.urlencode($text); |
|
| 139 | + return $this->api_v2 . $query . '&q=' . urlencode($text); |
|
| 140 | 140 | } |
| 141 | 141 | |
| 142 | 142 | /** |
@@ -31,7 +31,7 @@ |
||
| 31 | 31 | */ |
| 32 | 32 | public function register() |
| 33 | 33 | { |
| 34 | - $this->app->singleton('translug', function () { |
|
| 34 | + $this->app->singleton('translug', function() { |
|
| 35 | 35 | if (!empty(config('services.youdao.appKey'))) { |
| 36 | 36 | $config = [ |
| 37 | 37 | 'appKey' => config('services.youdao.appKey'), |