]> scripts.mit.edu Git - autoinstalls/mediawiki.git/blobdiff - languages/classes/LanguageKk_cyrl.php
MediaWiki 1.30.2
[autoinstalls/mediawiki.git] / languages / classes / LanguageKk_cyrl.php
index 78febae1f339adfa2be0ef71d88f37114ece0e65..39d19e75f241d7095d0eeec9159b03ab24331a79 100644 (file)
@@ -1,17 +1,44 @@
 <?php
-/** Kazakh (Қазақша)
+/**
+ * Kazakh (Қазақша) specific code.
  *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ * http://www.gnu.org/copyleft/gpl.html
+ *
+ * @file
  * @ingroup Language
  */
 
+/**
+ * Kazakh (Қазақша)
+ *
+ * @ingroup Language
+ */
+// @codingStandardsIgnoreStart Ignore class name is not in camel caps format error
 class LanguageKk_cyrl extends Language {
-
+       // @codingStandardsIgnoreEnd
        # Convert from the nominative form of a noun to some other case
        # Invoked with {{GRAMMAR:case|word}}
        /**
         * Cases: genitive, dative, accusative, locative, ablative, comitative + possessive forms
+        *
+        * @param string $word
+        * @param string $case
+        *
+        * @return string
         */
-
        function convertGrammarKk_cyrl( $word, $case ) {
                global $wgGrammarForms;
                if ( isset( $wgGrammarForms['kk-kz'][$case][$word] ) ) {
@@ -22,20 +49,20 @@ class LanguageKk_cyrl extends Language {
                }
                // Set up some constants...
                // Vowels in last syllable
-               $frontVowels = array( "е", "ө", "ү", "і", "ә", "э", "я", "ё", "и" );
-               $backVowels = array( "а", "о", "ұ", "ы" );
-               $allVowels = array( "е", "ө", "ү", "і", "ә", "э", "а", "о", "ұ", "ы", "я", "ё", "и" );
+               $frontVowels = [ "е", "ө", "ү", "і", "ә", "э", "я", "ё", "и" ];
+               $backVowels = [ "а", "о", "ұ", "ы" ];
+               $allVowels = [ "е", "ө", "ү", "і", "ә", "э", "а", "о", "ұ", "ы", "я", "ё", "и" ];
                // Preceding letters
-               $Nasals = array( "м", "н", "ң" );
-               $Sonants = array( "и", "й", "л", "р", "у", "ю" );
-               $Consonants = array( "п", "ф", "к", "қ", "т", "ш", "с", "х", "ц", "ч", "щ", "б", "в", "г", "д" );
-               $Sibilants = array( "ж", "з" );
-               $Sonorants = array( "и", "й", "л", "р", "у", "ю", "м", "н", "ң", "ж", "з" );
+               $Nasals = [ "м", "н", "ң" ];
+               $Sonants = [ "и", "й", "л", "р", "у", "ю" ];
+               $Consonants = [ "п", "ф", "к", "қ", "т", "ш", "с", "х", "ц", "ч", "щ", "б", "в", "г", "д" ];
+               $Sibilants = [ "ж", "з" ];
+               $Sonorants = [ "и", "й", "л", "р", "у", "ю", "м", "н", "ң", "ж", "з" ];
 
                // Possessives
-               $firstPerson = array( "м", "ң" ); // 1st singular, 2nd unformal
-               $secondPerson = array( "з" ); // 1st plural, 2nd formal
-               $thirdPerson = array( "ы", "і" ); // 3rd
+               $firstPerson = [ "м", "ң" ]; // 1st singular, 2nd unformal
+               $secondPerson = [ "з" ]; // 1st plural, 2nd formal
+               $thirdPerson = [ "ы", "і" ]; // 3rd
 
                $lastLetter = $this->lastLetter( $word, $allVowels );
                $wordEnding =& $lastLetter[0];
@@ -89,14 +116,14 @@ class LanguageKk_cyrl extends Language {
                                        } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
                                                $word = $word . "а";
                                        }
-                               } elseif ( in_array( $wordEnding, $secondPerson  ) ) {
+                               } elseif ( in_array( $wordEnding, $secondPerson ) ) {
                                        if ( in_array( $wordLastVowel, $frontVowels ) ) {
                                                $word = $word . "ге";
                                        } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
                                                $word = $word . "ға";
                                        }
-                               } elseif ( in_array( $wordEnding, $thirdPerson  ) ) {
-                                 if ( in_array( $wordLastVowel, $frontVowels ) ) {
+                               } elseif ( in_array( $wordEnding, $thirdPerson ) ) {
+                                       if ( in_array( $wordLastVowel, $frontVowels ) ) {
                                                $word = $word . "не";
                                        } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
                                                $word = $word . "на";
@@ -127,13 +154,13 @@ class LanguageKk_cyrl extends Language {
                                break;
                        case "dc31":
                        case "possessive accusative": # täweldık + tabıs
-                               if ( in_array( $wordEnding, $firstPerson ) || in_array( $wordEnding, $secondPerson  ) ) {
+                               if ( in_array( $wordEnding, $firstPerson ) || in_array( $wordEnding, $secondPerson ) ) {
                                        if ( in_array( $wordLastVowel, $frontVowels ) ) {
                                                $word = $word . "ді";
                                        } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
                                                $word = $word . "ды";
                                        }
-                               } elseif ( in_array( $wordEnding, $thirdPerson  ) ) {
+                               } elseif ( in_array( $wordEnding, $thirdPerson ) ) {
                                                $word = $word . "н";
                                }
                                break;
@@ -155,13 +182,13 @@ class LanguageKk_cyrl extends Language {
                                break;
                        case "dc41":
                        case "possessive locative": # täweldık + jatıs
-                               if ( in_array( $wordEnding, $firstPerson ) || in_array( $wordEnding, $secondPerson  ) ) {
+                               if ( in_array( $wordEnding, $firstPerson ) || in_array( $wordEnding, $secondPerson ) ) {
                                        if ( in_array( $wordLastVowel, $frontVowels ) ) {
                                                $word = $word . "де";
                                        } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
                                                $word = $word . "да";
                                        }
-                               } elseif ( in_array( $wordEnding, $thirdPerson  ) ) {
+                               } elseif ( in_array( $wordEnding, $thirdPerson ) ) {
                                        if ( in_array( $wordLastVowel, $frontVowels ) ) {
                                                $word = $word . "нде";
                                        } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
@@ -177,13 +204,16 @@ class LanguageKk_cyrl extends Language {
                                        } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
                                                $word = $word . "тан";
                                        }
-                               } elseif ( in_array( $wordEnding, $allVowels ) || in_array( $wordEnding, $Sonants ) || in_array( $wordEnding, $Sibilants ) ) {
+                               } elseif ( in_array( $wordEnding, $allVowels )
+                                       || in_array( $wordEnding, $Sonants )
+                                       || in_array( $wordEnding, $Sibilants )
+                               ) {
                                        if ( in_array( $wordLastVowel, $frontVowels ) ) {
                                                $word = $word . "ден";
                                        } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
                                                $word = $word . "дан";
                                        }
-                               }  elseif ( in_array( $wordEnding, $Nasals ) ) {
+                               } elseif ( in_array( $wordEnding, $Nasals ) ) {
                                        if ( in_array( $wordLastVowel, $frontVowels ) ) {
                                                $word = $word . "нен";
                                        } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
@@ -193,13 +223,13 @@ class LanguageKk_cyrl extends Language {
                                break;
                        case "dc51":
                        case "possessive ablative": # täweldık + şığıs
-                               if ( in_array( $wordEnding, $firstPerson ) || in_array( $wordEnding, $thirdPerson  ) ) {
+                               if ( in_array( $wordEnding, $firstPerson ) || in_array( $wordEnding, $thirdPerson ) ) {
                                        if ( in_array( $wordLastVowel, $frontVowels ) ) {
                                                $word = $word . "нен";
                                        } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
                                                $word = $word . "нан";
                                        }
-                               } elseif ( in_array( $wordEnding, $secondPerson  ) ) {
+                               } elseif ( in_array( $wordEnding, $secondPerson ) ) {
                                        if ( in_array( $wordLastVowel, $frontVowels ) ) {
                                                $word = $word . "ден";
                                        } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
@@ -211,7 +241,10 @@ class LanguageKk_cyrl extends Language {
                        case "comitative": # kömektes
                                if ( in_array( $wordEnding, $Consonants ) ) {
                                                $word = $word . "пен";
-                               } elseif ( in_array( $wordEnding, $allVowels ) || in_array( $wordEnding, $Nasals ) || in_array( $wordEnding, $Sonants ) ) {
+                               } elseif ( in_array( $wordEnding, $allVowels )
+                                       || in_array( $wordEnding, $Nasals )
+                                       || in_array( $wordEnding, $Sonants )
+                               ) {
                                                $word = $word . "мен";
                                } elseif ( in_array( $wordEnding, $Sibilants ) ) {
                                                $word = $word . "бен";
@@ -221,7 +254,10 @@ class LanguageKk_cyrl extends Language {
                        case "possessive comitative": # täweldık + kömektes
                                if ( in_array( $wordEnding, $Consonants ) ) {
                                                $word = $word . "пенен";
-                               } elseif ( in_array( $wordEnding, $allVowels ) || in_array( $wordEnding, $Nasals ) || in_array( $wordEnding, $Sonants ) ) {
+                               } elseif ( in_array( $wordEnding, $allVowels )
+                                       || in_array( $wordEnding, $Nasals )
+                                       || in_array( $wordEnding, $Sonants )
+                               ) {
                                                $word = $word . "менен";
                                } elseif ( in_array( $wordEnding, $Sibilants ) ) {
                                                $word = $word . "бенен";
@@ -232,6 +268,11 @@ class LanguageKk_cyrl extends Language {
                return $word;
        }
 
+       /**
+        * @param string $word
+        * @param string $case
+        * @return string
+        */
        function convertGrammarKk_latn( $word, $case ) {
                global $wgGrammarForms;
                if ( isset( $wgGrammarForms['kk-tr'][$case][$word] ) ) {
@@ -242,20 +283,20 @@ class LanguageKk_cyrl extends Language {
                }
                // Set up some constants...
                // Vowels in last syllable
-               $frontVowels = array( "e", "ö", "ü", "i", "ä", "é" );
-               $backVowels = array( "a", "o", "u", "ı" );
-               $allVowels = array( "e", "ö", "ü", "i", "ä", "é", "a", "o", "u", "ı" );
+               $frontVowels = [ "e", "ö", "ü", "i", "ä", "é" ];
+               $backVowels = [ "a", "o", "u", "ı" ];
+               $allVowels = [ "e", "ö", "ü", "i", "ä", "é", "a", "o", "u", "ı" ];
                // Preceding letters
-               $Nasals = array( "m", "n", "ñ" );
-               $Sonants = array( "ï", "y", "ý", "l", "r", "w" );
-               $Consonants = array( "p", "f", "k", "q", "t", "ş", "s", "x", "c", "ç", "b", "v", "g", "d" );
-               $Sibilants = array( "j", "z" );
-               $Sonorants = array( "ï", "y", "ý", "l", "r", "w", "m", "n", "ñ", "j", "z" );
+               $Nasals = [ "m", "n", "ñ" ];
+               $Sonants = [ "ï", "y", "ý", "l", "r", "w" ];
+               $Consonants = [ "p", "f", "k", "q", "t", "ş", "s", "x", "c", "ç", "b", "v", "g", "d" ];
+               $Sibilants = [ "j", "z" ];
+               $Sonorants = [ "ï", "y", "ý", "l", "r", "w", "m", "n", "ñ", "j", "z" ];
 
                // Possessives
-               $firstPerson = array( "m", "ñ" ); // 1st singular, 2nd unformal
-               $secondPerson = array( "z" ); // 1st plural, 2nd formal
-               $thirdPerson = array( "ı", "i" ); // 3rd
+               $firstPerson = [ "m", "ñ" ]; // 1st singular, 2nd unformal
+               $secondPerson = [ "z" ]; // 1st plural, 2nd formal
+               $thirdPerson = [ "ı", "i" ]; // 3rd
 
                $lastLetter = $this->lastLetter( $word, $allVowels );
                $wordEnding =& $lastLetter[0];
@@ -309,14 +350,14 @@ class LanguageKk_cyrl extends Language {
                                        } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
                                                $word = $word . "a";
                                        }
-                               } elseif ( in_array( $wordEnding, $secondPerson  ) ) {
+                               } elseif ( in_array( $wordEnding, $secondPerson ) ) {
                                        if ( in_array( $wordLastVowel, $frontVowels ) ) {
                                                $word = $word . "ge";
                                        } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
                                                $word = $word . "ğa";
                                        }
-                               } elseif ( in_array( $wordEnding, $thirdPerson  ) ) {
-                                 if ( in_array( $wordLastVowel, $frontVowels ) ) {
+                               } elseif ( in_array( $wordEnding, $thirdPerson ) ) {
+                                       if ( in_array( $wordLastVowel, $frontVowels ) ) {
                                                $word = $word . "ne";
                                        } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
                                                $word = $word . "na";
@@ -347,13 +388,13 @@ class LanguageKk_cyrl extends Language {
                                break;
                        case "dc31":
                        case "possessive accusative": # täweldık + tabıs
-                               if ( in_array( $wordEnding, $firstPerson ) || in_array( $wordEnding, $secondPerson  ) ) {
+                               if ( in_array( $wordEnding, $firstPerson ) || in_array( $wordEnding, $secondPerson ) ) {
                                        if ( in_array( $wordLastVowel, $frontVowels ) ) {
                                                $word = $word . "di";
                                        } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
                                                $word = $word . "dı";
                                        }
-                               } elseif ( in_array( $wordEnding, $thirdPerson  ) ) {
+                               } elseif ( in_array( $wordEnding, $thirdPerson ) ) {
                                                $word = $word . "n";
                                }
                                break;
@@ -375,13 +416,13 @@ class LanguageKk_cyrl extends Language {
                                break;
                        case "dc41":
                        case "possessive locative": # täweldık + jatıs
-                               if ( in_array( $wordEnding, $firstPerson ) || in_array( $wordEnding, $secondPerson  ) ) {
+                               if ( in_array( $wordEnding, $firstPerson ) || in_array( $wordEnding, $secondPerson ) ) {
                                        if ( in_array( $wordLastVowel, $frontVowels ) ) {
                                                $word = $word . "de";
                                        } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
                                                $word = $word . "da";
                                        }
-                               } elseif ( in_array( $wordEnding, $thirdPerson  ) ) {
+                               } elseif ( in_array( $wordEnding, $thirdPerson ) ) {
                                        if ( in_array( $wordLastVowel, $frontVowels ) ) {
                                                $word = $word . "nde";
                                        } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
@@ -397,13 +438,16 @@ class LanguageKk_cyrl extends Language {
                                        } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
                                                $word = $word . "tan";
                                        }
-                               } elseif ( in_array( $wordEnding, $allVowels ) || in_array( $wordEnding, $Sonants ) || in_array( $wordEnding, $Sibilants ) ) {
+                               } elseif ( in_array( $wordEnding, $allVowels )
+                                       || in_array( $wordEnding, $Sonants )
+                                       || in_array( $wordEnding, $Sibilants )
+                               ) {
                                        if ( in_array( $wordLastVowel, $frontVowels ) ) {
                                                $word = $word . "den";
                                        } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
                                                $word = $word . "dan";
                                        }
-                               }  elseif ( in_array( $wordEnding, $Nasals ) ) {
+                               } elseif ( in_array( $wordEnding, $Nasals ) ) {
                                        if ( in_array( $wordLastVowel, $frontVowels ) ) {
                                                $word = $word . "nen";
                                        } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
@@ -413,13 +457,13 @@ class LanguageKk_cyrl extends Language {
                                break;
                        case "dc51":
                        case "possessive ablative": # täweldık + şığıs
-                               if ( in_array( $wordEnding, $firstPerson ) || in_array( $wordEnding, $thirdPerson  ) ) {
+                               if ( in_array( $wordEnding, $firstPerson ) || in_array( $wordEnding, $thirdPerson ) ) {
                                        if ( in_array( $wordLastVowel, $frontVowels ) ) {
                                                $word = $word . "nen";
                                        } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
                                                $word = $word . "nan";
                                        }
-                               } elseif ( in_array( $wordEnding, $secondPerson  ) ) {
+                               } elseif ( in_array( $wordEnding, $secondPerson ) ) {
                                        if ( in_array( $wordLastVowel, $frontVowels ) ) {
                                                $word = $word . "den";
                                        } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
@@ -431,7 +475,10 @@ class LanguageKk_cyrl extends Language {
                        case "comitative": # kömektes
                                if ( in_array( $wordEnding, $Consonants ) ) {
                                                $word = $word . "pen";
-                               } elseif ( in_array( $wordEnding, $allVowels ) || in_array( $wordEnding, $Nasals ) || in_array( $wordEnding, $Sonants ) ) {
+                               } elseif ( in_array( $wordEnding, $allVowels )
+                                       || in_array( $wordEnding, $Nasals )
+                                       || in_array( $wordEnding, $Sonants )
+                               ) {
                                                $word = $word . "men";
                                } elseif ( in_array( $wordEnding, $Sibilants ) ) {
                                                $word = $word . "ben";
@@ -441,7 +488,10 @@ class LanguageKk_cyrl extends Language {
                        case "possessive comitative": # täweldık + kömektes
                                if ( in_array( $wordEnding, $Consonants ) ) {
                                                $word = $word . "penen";
-                               } elseif ( in_array( $wordEnding, $allVowels ) || in_array( $wordEnding, $Nasals ) || in_array( $wordEnding, $Sonants ) ) {
+                               } elseif ( in_array( $wordEnding, $allVowels )
+                                       || in_array( $wordEnding, $Nasals )
+                                       || in_array( $wordEnding, $Sonants )
+                               ) {
                                                $word = $word . "menen";
                                } elseif ( in_array( $wordEnding, $Sibilants ) ) {
                                                $word = $word . "benen";
@@ -452,6 +502,11 @@ class LanguageKk_cyrl extends Language {
                return $word;
        }
 
+       /**
+        * @param string $word
+        * @param string $case
+        * @return string
+        */
        function convertGrammarKk_arab( $word, $case ) {
                global $wgGrammarForms;
                if ( isset( $wgGrammarForms['kk-cn'][$case][$word] ) ) {
@@ -462,20 +517,20 @@ class LanguageKk_cyrl extends Language {
                }
                // Set up some constants...
                // Vowels in last syllable
-               $frontVowels = array( "ە", "ٶ", "ٷ", "ٸ", "ٵ", "ە" );
-               $backVowels = array( "ا", "و", "ۇ", "ى"  );
-               $allVowels = array( "ە", "ٶ", "ٷ", "ٸ", "ٵ", "ە", "ا", "و", "ۇ", "ى" );
+               $frontVowels = [ "ە", "ٶ", "ٷ", "ٸ", "ٵ", "ە" ];
+               $backVowels = [ "ا", "و", "ۇ", "ى" ];
+               $allVowels = [ "ە", "ٶ", "ٷ", "ٸ", "ٵ", "ە", "ا", "و", "ۇ", "ى" ];
                // Preceding letters
-               $Nasals = array( "م", "ن", "ڭ" );
-               $Sonants = array( "ي", "ي", "ل", "ر", "ۋ" );
-               $Consonants = array( "پ", "ف", "ك", "ق", "ت", "ش", "س", "ح", "تس", "چ", "ب", "ۆ", "گ", "د" );
-               $Sibilants = array( "ج", "ز" );
-               $Sonorants = array( "ي", "ي", "ل", "ر", "ۋ", "م", "ن", "ڭ", "ج", "ز" );
+               $Nasals = [ "م", "ن", "ڭ" ];
+               $Sonants = [ "ي", "ي", "ل", "ر", "ۋ" ];
+               $Consonants = [ "پ", "ف", "ك", "ق", "ت", "ش", "س", "ح", "تس", "چ", "ب", "ۆ", "گ", "د" ];
+               $Sibilants = [ "ج", "ز" ];
+               $Sonorants = [ "ي", "ي", "ل", "ر", "ۋ", "م", "ن", "ڭ", "ج", "ز" ];
 
                // Possessives
-               $firstPerson = array( "م", "ڭ" ); // 1st singular, 2nd unformal
-               $secondPerson = array( "ز" ); // 1st plural, 2nd formal
-               $thirdPerson = array( "ى", "ٸ" ); // 3rd
+               $firstPerson = [ "م", "ڭ" ]; // 1st singular, 2nd unformal
+               $secondPerson = [ "ز" ]; // 1st plural, 2nd formal
+               $thirdPerson = [ "ى", "ٸ" ]; // 3rd
 
                $lastLetter = $this->lastLetter( $word, $allVowels );
                $wordEnding = $lastLetter[0];
@@ -529,14 +584,14 @@ class LanguageKk_cyrl extends Language {
                                        } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
                                                $word = $word . "ا";
                                        }
-                               } elseif ( in_array( $wordEnding, $secondPerson  ) ) {
+                               } elseif ( in_array( $wordEnding, $secondPerson ) ) {
                                        if ( in_array( $wordLastVowel, $frontVowels ) ) {
                                                $word = $word . "گە";
                                        } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
                                                $word = $word . "عا";
                                        }
-                               } elseif ( in_array( $wordEnding, $thirdPerson  ) ) {
-                                 if ( in_array( $wordLastVowel, $frontVowels ) ) {
+                               } elseif ( in_array( $wordEnding, $thirdPerson ) ) {
+                                       if ( in_array( $wordLastVowel, $frontVowels ) ) {
                                                $word = $word . "نە";
                                        } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
                                                $word = $word . "نا";
@@ -567,13 +622,13 @@ class LanguageKk_cyrl extends Language {
                                break;
                        case "dc31":
                        case "possessive accusative": # täweldık + tabıs
-                               if ( in_array( $wordEnding, $firstPerson ) || in_array( $wordEnding, $secondPerson  ) ) {
+                               if ( in_array( $wordEnding, $firstPerson ) || in_array( $wordEnding, $secondPerson ) ) {
                                        if ( in_array( $wordLastVowel, $frontVowels ) ) {
                                                $word = $word . "دٸ";
                                        } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
                                                $word = $word . "دى";
                                        }
-                               } elseif ( in_array( $wordEnding, $thirdPerson  ) ) {
+                               } elseif ( in_array( $wordEnding, $thirdPerson ) ) {
                                                $word = $word . "ن";
                                }
                                break;
@@ -595,13 +650,13 @@ class LanguageKk_cyrl extends Language {
                                break;
                        case "dc41":
                        case "possessive locative": # täweldık + jatıs
-                               if ( in_array( $wordEnding, $firstPerson ) || in_array( $wordEnding, $secondPerson  ) ) {
+                               if ( in_array( $wordEnding, $firstPerson ) || in_array( $wordEnding, $secondPerson ) ) {
                                        if ( in_array( $wordLastVowel, $frontVowels ) ) {
                                                $word = $word . "دە";
                                        } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
                                                $word = $word . "دا";
                                        }
-                               } elseif ( in_array( $wordEnding, $thirdPerson  ) ) {
+                               } elseif ( in_array( $wordEnding, $thirdPerson ) ) {
                                        if ( in_array( $wordLastVowel, $frontVowels ) ) {
                                                $word = $word . "ندە";
                                        } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
@@ -617,13 +672,16 @@ class LanguageKk_cyrl extends Language {
                                        } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
                                                $word = $word . "تان";
                                        }
-                               } elseif ( in_array( $wordEnding, $allVowels ) || in_array( $wordEnding, $Sonants ) || in_array( $wordEnding, $Sibilants ) ) {
+                               } elseif ( in_array( $wordEnding, $allVowels )
+                                       || in_array( $wordEnding, $Sonants )
+                                       || in_array( $wordEnding, $Sibilants )
+                               ) {
                                        if ( in_array( $wordLastVowel, $frontVowels ) ) {
                                                $word = $word . "دەن";
                                        } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
                                                $word = $word . "دان";
                                        }
-                               }  elseif ( in_array( $wordEnding, $Nasals ) ) {
+                               } elseif ( in_array( $wordEnding, $Nasals ) ) {
                                        if ( in_array( $wordLastVowel, $frontVowels ) ) {
                                                $word = $word . "نەن";
                                        } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
@@ -633,13 +691,13 @@ class LanguageKk_cyrl extends Language {
                                break;
                        case "dc51":
                        case "possessive ablative": # täweldık + şığıs
-                               if ( in_array( $wordEnding, $firstPerson ) || in_array( $wordEnding, $thirdPerson  ) ) {
+                               if ( in_array( $wordEnding, $firstPerson ) || in_array( $wordEnding, $thirdPerson ) ) {
                                        if ( in_array( $wordLastVowel, $frontVowels ) ) {
                                                $word = $word . "نەن";
                                        } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
                                                $word = $word . "نان";
                                        }
-                               } elseif ( in_array( $wordEnding, $secondPerson  ) ) {
+                               } elseif ( in_array( $wordEnding, $secondPerson ) ) {
                                        if ( in_array( $wordLastVowel, $frontVowels ) ) {
                                                $word = $word . "دەن";
                                        } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
@@ -651,7 +709,10 @@ class LanguageKk_cyrl extends Language {
                        case "comitative": # kömektes
                                if ( in_array( $wordEnding, $Consonants ) ) {
                                                $word = $word . "پەن";
-                               } elseif ( in_array( $wordEnding, $allVowels ) || in_array( $wordEnding, $Nasals ) || in_array( $wordEnding, $Sonants ) ) {
+                               } elseif ( in_array( $wordEnding, $allVowels )
+                                       || in_array( $wordEnding, $Nasals )
+                                       || in_array( $wordEnding, $Sonants )
+                               ) {
                                                $word = $word . "مەن";
                                } elseif ( in_array( $wordEnding, $Sibilants ) ) {
                                                $word = $word . "بەن";
@@ -661,7 +722,10 @@ class LanguageKk_cyrl extends Language {
                        case "possessive comitative": # täweldık + kömektes
                                if ( in_array( $wordEnding, $Consonants ) ) {
                                                $word = $word . "پەنەن";
-                               } elseif ( in_array( $wordEnding, $allVowels ) || in_array( $wordEnding, $Nasals ) || in_array( $wordEnding, $Sonants ) ) {
+                               } elseif ( in_array( $wordEnding, $allVowels )
+                                       || in_array( $wordEnding, $Nasals )
+                                       || in_array( $wordEnding, $Sonants )
+                               ) {
                                                $word = $word . "مەنەن";
                                } elseif ( in_array( $wordEnding, $Sibilants ) ) {
                                                $word = $word . "بەنەن";
@@ -672,8 +736,13 @@ class LanguageKk_cyrl extends Language {
                return $word;
        }
 
+       /**
+        * @param string $word
+        * @param array $allVowels
+        * @return array
+        */
        function lastLetter( $word, $allVowels ) {
-               $lastLetter = array();
+               $lastLetter = [];
 
                // Put the word in a form we can play with since we're using UTF-8
                $ar = preg_split( '//u', parent::lc( $word ), -1, PREG_SPLIT_NO_EMPTY );
@@ -686,7 +755,7 @@ class LanguageKk_cyrl extends Language {
                $lastLetter[0] = $ar[count( $ar ) - 1];
 
                // Find the last vowel in the word
-               $lastLetter[1] = NULL;
+               $lastLetter[1] = null;
                foreach ( $wordReversed as $xvalue ) {
                        foreach ( $allVowels as $yvalue ) {
                                if ( strcmp( $xvalue, $yvalue ) == 0 ) {
@@ -696,7 +765,7 @@ class LanguageKk_cyrl extends Language {
                                        continue;
                                }
                        }
-                       if ( $lastLetter[1] !== NULL ) {
+                       if ( $lastLetter[1] !== null ) {
                                break;
                        } else {
                                continue;
@@ -708,6 +777,10 @@ class LanguageKk_cyrl extends Language {
 
        /**
         * Avoid grouping whole numbers between 0 to 9999
+        *
+        * @param string $_
+        *
+        * @return string
         */
        function commafy( $_ ) {
                if ( !preg_match( '/^\d{1,4}$/', $_ ) ) {