Test Failed
Push — master ( 92981a...7302a7 )
by Justin
04:16
created
system/packages/com.jukusoft.cms.lang/classes/translator.php 2 patches
Indentation   +55 added lines, -55 removed lines patch added patch discarded remove patch
@@ -27,67 +27,67 @@
 block discarded – undo
27 27
 
28 28
 class Translator {
29 29
 
30
-	/**
31
-	 *
32
-	 */
33
-	protected static $backend = null;
30
+    /**
31
+     *
32
+     */
33
+    protected static $backend = null;
34 34
 
35
-	/**
36
-	 * translate a string
37
-	 *
38
-	 * @param string $key message to translate
39
-	 * @param string $domain domain where to search key (optional)
40
-	 * @param array $params array with params to replace in translated message
41
-	 *
42
-	 * @throws IllegalStateException if settings key "translator_class_name" is not set
43
-	 * @see Translator_Backend::translate()
44
-	 * @since 0.1.0
45
-	 *
46
-	 * @return string translated message
47
-	 */
48
-	public static function translate (string $key, string $domain = "", array $params = array()) : string {
49
-		return self::getBackend()->translate($key, $domain, $params);
50
-	}
35
+    /**
36
+     * translate a string
37
+     *
38
+     * @param string $key message to translate
39
+     * @param string $domain domain where to search key (optional)
40
+     * @param array $params array with params to replace in translated message
41
+     *
42
+     * @throws IllegalStateException if settings key "translator_class_name" is not set
43
+     * @see Translator_Backend::translate()
44
+     * @since 0.1.0
45
+     *
46
+     * @return string translated message
47
+     */
48
+    public static function translate (string $key, string $domain = "", array $params = array()) : string {
49
+        return self::getBackend()->translate($key, $domain, $params);
50
+    }
51 51
 
52
-	/**
53
-	 * translate a string, plural version of translate()
54
-	 *
55
-	 * @param string $key message to translate
56
-	 * @param string $domain domain where to search key (optional)
57
-	 * @param array $params array with params to replace in translated message
58
-	 *
59
-	 * @throws IllegalStateException if settings key "translator_class_name" is not set
60
-	 * @see Translator_Backend::n_translate()
61
-	 * @since 0.1.0
62
-	 *
63
-	 * @return string translated message
64
-	 */
65
-	public function n_translate (string $key, string $plural_key, int $n, string $domain = "", array $params = array()) : string {
66
-		return self::getBackend()->n_translate($key, $plural_key, $n, $domain, $params);
67
-	}
52
+    /**
53
+     * translate a string, plural version of translate()
54
+     *
55
+     * @param string $key message to translate
56
+     * @param string $domain domain where to search key (optional)
57
+     * @param array $params array with params to replace in translated message
58
+     *
59
+     * @throws IllegalStateException if settings key "translator_class_name" is not set
60
+     * @see Translator_Backend::n_translate()
61
+     * @since 0.1.0
62
+     *
63
+     * @return string translated message
64
+     */
65
+    public function n_translate (string $key, string $plural_key, int $n, string $domain = "", array $params = array()) : string {
66
+        return self::getBackend()->n_translate($key, $plural_key, $n, $domain, $params);
67
+    }
68 68
 
69
-	/**
70
-	 * get current instance of translator backend
71
-	 *
72
-	 * @see GetTextBackend
73
-	 *
74
-	 * @throws IllegalStateException if settings key "translator_class_name" is not set
75
-	 *
76
-	 * @return Translator_Backend instance of translator backend
77
-	 */
78
-	public static function &getBackend () : Translator_Backend {
79
-		if (self::$backend == null) {
80
-			//get translator backend
81
-			$class_name = Settings::get("translator_class_name", "GetTextBackend");
69
+    /**
70
+     * get current instance of translator backend
71
+     *
72
+     * @see GetTextBackend
73
+     *
74
+     * @throws IllegalStateException if settings key "translator_class_name" is not set
75
+     *
76
+     * @return Translator_Backend instance of translator backend
77
+     */
78
+    public static function &getBackend () : Translator_Backend {
79
+        if (self::$backend == null) {
80
+            //get translator backend
81
+            $class_name = Settings::get("translator_class_name", "GetTextBackend");
82 82
 
83
-			self::$backend = new $class_name();
83
+            self::$backend = new $class_name();
84 84
 
85
-			//initialize backend with current language
86
-			self::$backend->init(Registry::singleton()->getSetting("lang_token"));
87
-		}
85
+            //initialize backend with current language
86
+            self::$backend->init(Registry::singleton()->getSetting("lang_token"));
87
+        }
88 88
 
89
-		return self::$backend;
90
-	}
89
+        return self::$backend;
90
+    }
91 91
 
92 92
 }
93 93
 
Please login to merge, or discard this patch.
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -45,7 +45,7 @@  discard block
 block discarded – undo
45 45
 	 *
46 46
 	 * @return string translated message
47 47
 	 */
48
-	public static function translate (string $key, string $domain = "", array $params = array()) : string {
48
+	public static function translate(string $key, string $domain = "", array $params = array()) : string {
49 49
 		return self::getBackend()->translate($key, $domain, $params);
50 50
 	}
51 51
 
@@ -62,7 +62,7 @@  discard block
 block discarded – undo
62 62
 	 *
63 63
 	 * @return string translated message
64 64
 	 */
65
-	public function n_translate (string $key, string $plural_key, int $n, string $domain = "", array $params = array()) : string {
65
+	public function n_translate(string $key, string $plural_key, int $n, string $domain = "", array $params = array()) : string {
66 66
 		return self::getBackend()->n_translate($key, $plural_key, $n, $domain, $params);
67 67
 	}
68 68
 
@@ -75,7 +75,7 @@  discard block
 block discarded – undo
75 75
 	 *
76 76
 	 * @return Translator_Backend instance of translator backend
77 77
 	 */
78
-	public static function &getBackend () : Translator_Backend {
78
+	public static function &getBackend() : Translator_Backend {
79 79
 		if (self::$backend == null) {
80 80
 			//get translator backend
81 81
 			$class_name = Settings::get("translator_class_name", "GetTextBackend");
Please login to merge, or discard this patch.
system/packages/com.jukusoft.cms.lang/classes/translator_backend.php 2 patches
Indentation   +31 added lines, -31 removed lines patch added patch discarded remove patch
@@ -27,41 +27,41 @@
 block discarded – undo
27 27
 
28 28
 interface Translator_Backend {
29 29
 
30
-	/**
31
-	 * initialize translator backend
32
-	 *
33
-	 * @param $lang_token $lang_token contains language & country, e.q. de_DE
34
-	 */
35
-	public function init (string $lang_token);
30
+    /**
31
+     * initialize translator backend
32
+     *
33
+     * @param $lang_token $lang_token contains language & country, e.q. de_DE
34
+     */
35
+    public function init (string $lang_token);
36 36
 
37
-	/**
38
-	 * translate a string
39
-	 *
40
-	 * @param string $key message to translate
41
-	 * @param string $domain domain where to search key (optional)
42
-	 * @param array $params array with params to replace in translated message
43
-	 *
44
-	 * @return string translated message
45
-	 */
46
-	public function translate (string $key, string $domain = "", array $params = array()) : string;
37
+    /**
38
+     * translate a string
39
+     *
40
+     * @param string $key message to translate
41
+     * @param string $domain domain where to search key (optional)
42
+     * @param array $params array with params to replace in translated message
43
+     *
44
+     * @return string translated message
45
+     */
46
+    public function translate (string $key, string $domain = "", array $params = array()) : string;
47 47
 
48
-	/**
49
-	 * translate a string, plural version of translate()
50
-	 *
51
-	 * @see Translator_Backend::translate()
52
-	 * @since 0.1.0
53
-	 *
54
-	 * @param string $key message to translate
55
-	 * @param string $domain domain where to search key (optional)
56
-	 * @param array $params array with params to replace in translated message
57
-	 *
58
-	 * @return string translated message
59
-	 */
60
-	public function n_translate (string $key, string $plural_key, int $n, string $domain = "", array $params = array()) : string;
48
+    /**
49
+     * translate a string, plural version of translate()
50
+     *
51
+     * @see Translator_Backend::translate()
52
+     * @since 0.1.0
53
+     *
54
+     * @param string $key message to translate
55
+     * @param string $domain domain where to search key (optional)
56
+     * @param array $params array with params to replace in translated message
57
+     *
58
+     * @return string translated message
59
+     */
60
+    public function n_translate (string $key, string $plural_key, int $n, string $domain = "", array $params = array()) : string;
61 61
 
62
-	public function bindLangPack (string $domain, string $path);
62
+    public function bindLangPack (string $domain, string $path);
63 63
 
64
-	public function setDefaultDomain (string $domain);
64
+    public function setDefaultDomain (string $domain);
65 65
 
66 66
 }
67 67
 
Please login to merge, or discard this patch.
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -32,7 +32,7 @@  discard block
 block discarded – undo
32 32
 	 *
33 33
 	 * @param $lang_token $lang_token contains language & country, e.q. de_DE
34 34
 	 */
35
-	public function init (string $lang_token);
35
+	public function init(string $lang_token);
36 36
 
37 37
 	/**
38 38
 	 * translate a string
@@ -43,7 +43,7 @@  discard block
 block discarded – undo
43 43
 	 *
44 44
 	 * @return string translated message
45 45
 	 */
46
-	public function translate (string $key, string $domain = "", array $params = array()) : string;
46
+	public function translate(string $key, string $domain = "", array $params = array()) : string;
47 47
 
48 48
 	/**
49 49
 	 * translate a string, plural version of translate()
@@ -57,11 +57,11 @@  discard block
 block discarded – undo
57 57
 	 *
58 58
 	 * @return string translated message
59 59
 	 */
60
-	public function n_translate (string $key, string $plural_key, int $n, string $domain = "", array $params = array()) : string;
60
+	public function n_translate(string $key, string $plural_key, int $n, string $domain = "", array $params = array()) : string;
61 61
 
62
-	public function bindLangPack (string $domain, string $path);
62
+	public function bindLangPack(string $domain, string $path);
63 63
 
64
-	public function setDefaultDomain (string $domain);
64
+	public function setDefaultDomain(string $domain);
65 65
 
66 66
 }
67 67
 
Please login to merge, or discard this patch.
com.jukusoft.cms.dwoo/dwoo/lib/Dwoo/Plugins/Functions/PluginLang.php 1 patch
Indentation   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -33,16 +33,16 @@
 block discarded – undo
33 33
 
34 34
 class PluginLang extends Plugin implements ICompilable {
35 35
 
36
-	/**
37
-	 * @param Compiler $compiler
38
-	 * @param mixed    $value
39
-	 * @param mixed    $var
40
-	 *
41
-	 * @return string
42
-	 */
43
-	public static function compile(Compiler $compiler, $value, $domain = "") {
44
-		return 'Translator::translate(' . $value . ', ' . $domain . ')';
45
-	}
36
+    /**
37
+     * @param Compiler $compiler
38
+     * @param mixed    $value
39
+     * @param mixed    $var
40
+     *
41
+     * @return string
42
+     */
43
+    public static function compile(Compiler $compiler, $value, $domain = "") {
44
+        return 'Translator::translate(' . $value . ', ' . $domain . ')';
45
+    }
46 46
 
47 47
 }
48 48
 
Please login to merge, or discard this patch.
com.jukusoft.cms.dwoo/dwoo/lib/Dwoo/Plugins/Functions/PluginPLang.php 1 patch
Indentation   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -33,16 +33,16 @@
 block discarded – undo
33 33
 
34 34
 class PluginPLang extends Plugin implements ICompilable {
35 35
 
36
-	/**
37
-	 * @param Compiler $compiler
38
-	 * @param mixed    $value
39
-	 * @param mixed    $var
40
-	 *
41
-	 * @return string
42
-	 */
43
-	public static function compile(Compiler $compiler, $msg1, $msg2, $n, $domain = "") {
44
-		return 'Translator::n_translate(' . $msg1 . ', ' . $msg2 . ', ' . $n . ', ' . $domain . ')';
45
-	}
36
+    /**
37
+     * @param Compiler $compiler
38
+     * @param mixed    $value
39
+     * @param mixed    $var
40
+     *
41
+     * @return string
42
+     */
43
+    public static function compile(Compiler $compiler, $msg1, $msg2, $n, $domain = "") {
44
+        return 'Translator::n_translate(' . $msg1 . ', ' . $msg2 . ', ' . $n . ', ' . $domain . ')';
45
+    }
46 46
 
47 47
 }
48 48
 
Please login to merge, or discard this patch.