Completed
Pull Request — master (#11)
by Aitor Riba
02:38 queued 47s
created
src/Builder/Translation.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -118,7 +118,7 @@
 block discarded – undo
118 118
         if ($this->debug === true) {
119 119
             $this->translation = "<font style='color:#00CC00;'>Translation loaded from DB</font>";
120 120
         } else {
121
-            $this->translation = $existing[0]->translation;
121
+            $this->translation = $existing[ 0 ]->translation;
122 122
         }
123 123
 
124 124
         return true;
Please login to merge, or discard this patch.
src/Builder/MymemoryTrans.php 1 patch
Indentation   +29 added lines, -29 removed lines patch added patch discarded remove patch
@@ -5,42 +5,42 @@
 block discarded – undo
5 5
 class MymemoryTrans extends Translation
6 6
 {
7 7
     /**
8
-      * Get translation from mymemory API.
9
-      */
10
-     public function main()
11
-     {
12
-         $host = 'api.mymemory.translated.net';
8
+     * Get translation from mymemory API.
9
+     */
10
+        public function main()
11
+        {
12
+            $host = 'api.mymemory.translated.net';
13 13
 
14
-         // Check if host is online.
15
-         if ($this->checkHost($host)) {
14
+            // Check if host is online.
15
+            if ($this->checkHost($host)) {
16 16
 
17
-             // Host online
18
-             $urlString = urlencode($this->string);
19
-             $url = "http://$host/get?q=$urlString&langpair=$this->from%7C$this->to";
20
-             $json = file_get_contents($url);
21
-             $data = json_decode($json);
17
+                // Host online
18
+                $urlString = urlencode($this->string);
19
+                $url = "http://$host/get?q=$urlString&langpair=$this->from%7C$this->to";
20
+                $json = file_get_contents($url);
21
+                $data = json_decode($json);
22 22
 
23
-             // Checking response status
24
-             if ($data->responseStatus != 200) {
25
-                 if ($this->debug == true) {
26
-                     $details = $data->responseDetails;
27
-                     if ($data->responseStatus == 403) {
28
-                         $details = ($data->responseDetails);
29
-                     }
30
-                     $this->translation = "<font style='color:red;'>Error ".$data->responseStatus.': '.$details.'</font>';
31
-                 }
23
+                // Checking response status
24
+                if ($data->responseStatus != 200) {
25
+                    if ($this->debug == true) {
26
+                        $details = $data->responseDetails;
27
+                        if ($data->responseStatus == 403) {
28
+                            $details = ($data->responseDetails);
29
+                        }
30
+                        $this->translation = "<font style='color:red;'>Error ".$data->responseStatus.': '.$details.'</font>';
31
+                    }
32 32
 
33
-                 return;
34
-             }
33
+                    return;
34
+                }
35 35
 
36 36
 
37
-             $transObtained = $data->responseData->translatedText;
37
+                $transObtained = $data->responseData->translatedText;
38 38
 
39
-             $this->translation = ucfirst(strtolower(trim($transObtained)));
39
+                $this->translation = ucfirst(strtolower(trim($transObtained)));
40 40
 
41
-             $this->checkSave();
41
+                $this->checkSave();
42 42
 
43
-             return;
44
-         }
45
-     }
43
+                return;
44
+            }
45
+        }
46 46
 }
Please login to merge, or discard this patch.
src/Builder/Exception.php 1 patch
Indentation   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -5,10 +5,10 @@
 block discarded – undo
5 5
 class Exception extends Translation
6 6
 {
7 7
     /**
8
-      * Get translation from mymemory API.
9
-      */
10
-     public function main()
11
-     {
12
-         // Check if it can be translated from online sources.
13
-     }
8
+     * Get translation from mymemory API.
9
+     */
10
+        public function main()
11
+        {
12
+            // Check if it can be translated from online sources.
13
+        }
14 14
 }
Please login to merge, or discard this patch.
src/Builder.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -11,7 +11,7 @@
 block discarded – undo
11 11
     public static function trans($string)
12 12
     {
13 13
         $translator = config('laralang.default.translator');
14
-        if (!in_array(config('laralang.default.translator'), ['apertium', 'mymemory'])) {
14
+        if (!in_array(config('laralang.default.translator'), [ 'apertium', 'mymemory' ])) {
15 15
             return new Exception("<font style='color:red;'>Laralang doesn't support $translator translator. Check config</font>");
16 16
         } else {
17 17
             if (config('laralang.default.translator') == 'mymemory') {
Please login to merge, or discard this patch.