X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=languages%2Fclasses%2FLanguageKaa.php;h=a40fb7ae4334ccebfcd74e06d58d80e19e465b5e;hb=fe6cfdeca8cad5b975f0303df0edab1219d8d533;hp=f9f61dbd737c689c15bf5137ec3dbf8b62b0658c;hpb=3691410d1061aaa01faa083fb497480201e87efb;p=lhc%2Fweb%2Fwiklou.git diff --git a/languages/classes/LanguageKaa.php b/languages/classes/LanguageKaa.php index f9f61dbd73..a40fb7ae43 100644 --- a/languages/classes/LanguageKaa.php +++ b/languages/classes/LanguageKaa.php @@ -10,6 +10,11 @@ class LanguageKaa extends Language { # Invoked with {{GRAMMAR:case|word}} /** * Cases: genitive, dative, accusative, locative, ablative, comitative + possessive forms + * + * @param $word string + * @param $case string + * + * @return string */ function convertGrammar( $word, $case ) { global $wgGrammarForms; @@ -19,39 +24,47 @@ class LanguageKaa extends Language { /* Full code of function convertGrammar() is in development. Updates coming soon. */ return $word; } - /* + + /** * It fixes issue with ucfirst for transforming 'i' to 'İ' * + * @param $string string + * + * @return string */ function ucfirst ( $string ) { - if ( $string[0] == 'i' ) { - $string = 'İ' . substr( $string, 1 ); + if ( substr( $string, 0, 1 ) === 'i' ) { + return 'İ' . substr( $string, 1 ); } else { - $string = parent::ucfirst( $string ); + return parent::ucfirst( $string ); } - return $string; - } - /* + /** * It fixes issue with lcfirst for transforming 'I' to 'ı' * + * @param $string string + * + * @return string */ function lcfirst ( $string ) { - if ( $string[0] == 'I' ) { - $string = 'ı' . substr( $string, 1 ); + if ( substr( $string, 0, 1 ) === 'I' ) { + return 'ı' . substr( $string, 1 ); } else { - $string = parent::lcfirst( $string ); + return parent::lcfirst( $string ); } - return $string; } /** * Avoid grouping whole numbers between 0 to 9999 + * + * @param $_ string + * + * @return string */ function commafy( $_ ) { if ( !preg_match( '/^\d{1,4}$/', $_ ) ) { - return strrev( (string)preg_replace( '/(\d{3})(?=\d)(?!\d*\.)/', '$1,', strrev($_) ) ); + return strrev( (string)preg_replace( '/(\d{3})(?=\d)(?!\d*\.)/', '$1,', strrev( $_ ) ) ); } else { return $_; }