Passed
Push — master ( 85b4ce...18c191 )
by Afshin
02:38
created
core/Translator/Translator.php 2 patches
Spacing   +16 added lines, -16 removed lines patch added patch discarded remove patch
@@ -23,38 +23,38 @@  discard block
 block discarded – undo
23 23
 
24 24
     }
25 25
 
26
-    private function _loadkey(string $key , array $replace = [])
26
+    private function _loadkey(string $key, array $replace = [])
27 27
     {
28
-        list($namespace,$group) = explode('.',$key);
28
+        list($namespace, $group) = explode('.', $key);
29 29
         $t_dir = $this->getTranslation_dirs();
30 30
 
31
-        if(in_array($this->local,$t_dir)){
31
+        if (in_array($this->local, $t_dir)) {
32 32
 
33
-            $translationBaseFolder = $this->settings['translation']['translations_path'].$this->local;
34
-            $translationBaseFile = $translationBaseFolder.'/'.$namespace.'.php';
35
-            if(file_exists($translationBaseFile)){
36
-                $lang= include_once ($translationBaseFile);
37
-            }else{
33
+            $translationBaseFolder = $this->settings['translation']['translations_path'] . $this->local;
34
+            $translationBaseFile = $translationBaseFolder . '/' . $namespace . '.php';
35
+            if (file_exists($translationBaseFile)) {
36
+                $lang = include_once ($translationBaseFile);
37
+            }else {
38 38
                 return $lang[$group] = $key;
39 39
 
40 40
             }
41
-        }else{
41
+        }else {
42 42
         }
43 43
 
44
-        if(count($replace) > 0){
45
-            foreach($replace as $key=>$replace_item){
46
-                if(strpos($lang[$group],'%') != 0){
47
-                    str_replace($key,$replace_item,$lang[$group]);
44
+        if (count($replace) > 0) {
45
+            foreach ($replace as $key=>$replace_item) {
46
+                if (strpos($lang[$group], '%') != 0) {
47
+                    str_replace($key, $replace_item, $lang[$group]);
48 48
                 }
49 49
             }
50
-        }else{
50
+        }else {
51 51
             return $lang[$group];
52 52
         }
53 53
     }
54 54
 
55 55
     public function trans(string $key, array $replace = [])
56 56
     {
57
-        return $this->_loadkey($key,$replace);
57
+        return $this->_loadkey($key, $replace);
58 58
     }
59 59
 
60 60
 
@@ -66,7 +66,7 @@  discard block
 block discarded – undo
66 66
 
67 67
 
68 68
 
69
-        return array_diff($dir,$ex_folders);
69
+        return array_diff($dir, $ex_folders);
70 70
     }
71 71
 
72 72
 }
73 73
\ No newline at end of file
Please login to merge, or discard this patch.
Braces   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -34,11 +34,11 @@  discard block
 block discarded – undo
34 34
             $translationBaseFile = $translationBaseFolder.'/'.$namespace.'.php';
35 35
             if(file_exists($translationBaseFile)){
36 36
                 $lang= include_once ($translationBaseFile);
37
-            }else{
37
+            } else{
38 38
                 return $lang[$group] = $key;
39 39
 
40 40
             }
41
-        }else{
41
+        } else{
42 42
         }
43 43
 
44 44
         if(count($replace) > 0){
@@ -47,7 +47,7 @@  discard block
 block discarded – undo
47 47
                     str_replace($key,$replace_item,$lang[$group]);
48 48
                 }
49 49
             }
50
-        }else{
50
+        } else{
51 51
             return $lang[$group];
52 52
         }
53 53
     }
Please login to merge, or discard this patch.