src/Russian/FirstNamesInflection.php
public static function isMutable($name, $gender = null)
    {
        $name = S::lower($name);

        if (in_array($name, static::$immutableNames, true)) {
            return false;
        }

        if ($gender === null) {
            $gender = static::detectGender($name);
        }

        // man rules
        if ($gender === static::MALE) {
            // soft consonant
            if (S::lower(S::slice($name, -1)) == 'ь' && static::isConsonant(S::slice($name, -2, -1))) {
                return true;
            } elseif (in_array(S::slice($name, -1), array_diff(static::$consonants, ['й', /*'Ч', 'Щ'*/]), true)) { // hard consonant
                return true;
            } elseif (S::slice($name, -1) == 'й') {
                return true;
            } else if (in_array(S::slice($name, -2), ['ло', 'ко'], true)) {
                return true;
            }
        } else if ($gender === static::FEMALE) {
            // soft consonant
            if (S::lower(S::slice($name, -1)) == 'ь' && static::isConsonant(S::slice($name, -2, -1))) {
                return true;
            } else if (static::isHissingConsonant(S::slice($name, -1))) {
                return true;
            }
        }

        // common rules
        if ((in_array(S::slice($name, -1), ['а', 'я']) && !static::isVowel(S::slice($name, -2, -1))) || in_array(S::slice($name, -2), ['ия', 'ья', 'ея', 'оя'], true)) {
            return true;
        }

        return false;
    }
public static function isMutable($name, $gender = null)
    {
        $name = S::lower($name);

        if (in_array($name, static::$immutableNames, true)) {
            return false;
        }

        if ($gender === null) {
            $gender = static::detectGender($name);
        }

        // man rules
        if ($gender === static::MALE) {
            // soft consonant
            if (S::lower(S::slice($name, -1)) == 'ь' && static::isConsonant(S::slice($name, -2, -1))) {
                return true;
            } elseif (in_array(S::slice($name, -1), array_diff(static::$consonants, ['й', /*'Ч', 'Щ'*/]), true)) { // hard consonant
                return true;
            } elseif (S::slice($name, -1) == 'й') {
                return true;
            } else if (in_array(S::slice($name, -2), ['ло', 'ко'], true)) {
                return true;
            }
        } else if ($gender === static::FEMALE) {
            // soft consonant
            if (S::lower(S::slice($name, -1)) == 'ь' && static::isConsonant(S::slice($name, -2, -1))) {
                return true;
            } else if (static::isHissingConsonant(S::slice($name, -1))) {
                return true;
            }
        }

        // common rules
        if ((in_array(S::slice($name, -1), ['а', 'я']) && !static::isVowel(S::slice($name, -2, -1))) || in_array(S::slice($name, -2), ['ия', 'ья', 'ея', 'оя'], true)) {
            return true;
        }

        return false;
    }
Checks if name is mutable
@param string $name
@param null|string $gender
@return bool