1212
1313namespace chillerlan \bbcode \Language ;
1414
15- use chillerlan \bbcode \Traits \ClassLoaderTrait ;
16-
1715/**
18- * @method string parserExceptionCallback($override_language = null)
19- * @method string parserExceptionMatchall($override_language = null)
16+ * @method string parserExceptionCallback(string $LanguageInterface = null)
17+ * @method string parserExceptionMatchall(string $LanguageInterface = null)
2018 *
21- * @method string codeDisplayCSS($override_language = null)
22- * @method string codeDisplayPHP($override_language = null)
23- * @method string codeDisplaySQL($override_language = null)
24- * @method string codeDisplayXML($override_language = null)
25- * @method string codeDisplayHTML($override_language = null)
26- * @method string codeDisplayJS($override_language = null)
27- * @method string codeDisplayJSON($override_language = null)
28- * @method string codeDisplayPRE($override_language = null)
29- * @method string codeDisplayCODE($override_language = null)
30- * @method string codeDisplayNSIS($override_language = null)
19+ * @method string codeDisplayCSS(string $LanguageInterface = null)
20+ * @method string codeDisplayPHP(string $LanguageInterface = null)
21+ * @method string codeDisplaySQL(string $LanguageInterface = null)
22+ * @method string codeDisplayXML(string $LanguageInterface = null)
23+ * @method string codeDisplayHTML(string $LanguageInterface = null)
24+ * @method string codeDisplayJS(string $LanguageInterface = null)
25+ * @method string codeDisplayJSON(string $LanguageInterface = null)
26+ * @method string codeDisplayPRE(string $LanguageInterface = null)
27+ * @method string codeDisplayCODE(string $LanguageInterface = null)
28+ * @method string codeDisplayNSIS(string $LanguageInterface = null)
3129 *
32- * @method string expanderDisplayExpander($override_language = null)
33- * @method string expanderDisplayQuote($override_language = null)
34- * @method string expanderDisplaySpoiler($override_language = null)
35- * @method string expanderDisplayTrigger($override_language = null)
30+ * @method string expanderDisplayExpander(string $LanguageInterface = null)
31+ * @method string expanderDisplayQuote(string $LanguageInterface = null)
32+ * @method string expanderDisplaySpoiler(string $LanguageInterface = null)
33+ * @method string expanderDisplayTrigger(string $LanguageInterface = null)
3634 */
3735abstract class LanguageAbstract implements LanguageInterface{
38- use ClassLoaderTrait;
3936
4037 /**
4138 * It's magic.
@@ -53,15 +50,15 @@ public function __call(string $name, array $arguments){
5350 * Returns a language string for a given key and overrides the current language if desired.
5451 *
5552 * @param string $key
56- * @param string $override_language (a LanguageInterface FQCN)
53+ * @param string $LanguageInterface (a LanguageInterface FQCN)
5754 *
58- * @return mixed
55+ * @return string
5956 * @throws \chillerlan\bbcode\BBCodeException
6057 */
61- public function string (string $ key , string $ override_language = null ){
58+ public function string (string $ key , string $ LanguageInterface = null ): string {
6259
63- if ($ override_language ){
64- return $ this -> __loadClass ( $ override_language , LanguageInterface::class )->{$ key }();
60+ if ($ LanguageInterface ){
61+ return ( new $ LanguageInterface )->{$ key }();
6562 }
6663
6764 return $ this ->{$ key };
0 commit comments