Illuminate\Support\Pluralizer::matchCase PHP Method

matchCase() protected static method

Attempt to match the case on two strings.
protected static matchCase ( string $value, string $comparison ) : string
$value string
$comparison string
return string
    protected static function matchCase($value, $comparison)
    {
        $functions = ['mb_strtolower', 'mb_strtoupper', 'ucfirst', 'ucwords'];
        foreach ($functions as $function) {
            if (call_user_func($function, $comparison) === $comparison) {
                return call_user_func($function, $value);
            }
        }
        return $value;
    }