Inflection.php
public static function word($text, $case, $plural, $animate = false, $preferredGender = '')
    {
        if (self::$instance === null) {
            self::$instance = new Inflection();
        }

        $result = self::$instance->inflect($text, $animate, $preferredGender);

        if (14 === \count($result)) {
            return trim($result[$case + ((int)$plural * 7)]);
        }

        return trim($text);
    }
public static function word($text, $case, $plural, $animate = false, $preferredGender = '')
    {
        if (self::$instance === null) {
            self::$instance = new Inflection();
        }

        $result = self::$instance->inflect($text, $animate, $preferredGender);

        if (14 === \count($result)) {
            return trim($result[$case + ((int)$plural * 7)]);
        }

        return trim($text);
    }
Inflect string

@param string $text Input string
@param int $case Case 1-7
@param bool $plural Want plural inflection
@param bool $animate Is word animate
@param string $preferredGender Preferred gender (M, Z, S) or empty string
@return string Inflected string or original string on error