@@ -65,7 +65,7 @@ discard block |
||
| 65 | 65 | */ |
| 66 | 66 | private function getTranslatedText($text) |
| 67 | 67 | { |
| 68 | - if ( $this->isEnglish($text) ) { |
|
| 68 | + if ($this->isEnglish($text)) { |
|
| 69 | 69 | return $text; |
| 70 | 70 | } |
| 71 | 71 | $text = $this->removeSegment($text); |
@@ -82,7 +82,7 @@ discard block |
||
| 82 | 82 | */ |
| 83 | 83 | private function getTranslation(array $translateResponse) |
| 84 | 84 | { |
| 85 | - if ((int) $translateResponse['errorCode'] === 0 ) { |
|
| 85 | + if ((int) $translateResponse['errorCode'] === 0) { |
|
| 86 | 86 | return $this->getTranslatedTextFromResponse($translateResponse); |
| 87 | 87 | } |
| 88 | 88 | throw new TranslationErrorException('Translate error, error_code : ' . $translateResponse['errorCode'] . '. Refer url: http://ai.youdao.com/docs/api.s'); |
@@ -121,7 +121,7 @@ discard block |
||
| 121 | 121 | */ |
| 122 | 122 | private function isEnglish($text) |
| 123 | 123 | { |
| 124 | - if ( preg_match("/\p{Han}+/u", $text) ) { |
|
| 124 | + if (preg_match("/\p{Han}+/u", $text)) { |
|
| 125 | 125 | return false; |
| 126 | 126 | } |
| 127 | 127 | |
@@ -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 | return new Translation(new Client(), config('services.youdao')); |
| 36 | 36 | }); |
| 37 | 37 | } |