private static function stringifyArrayKey(array $key): string
    {
        ksort($key);

        foreach ($key as &$value) {
            if (is_array($value)) {
                $value = self::stringifyArrayKey($value);
            } elseif (is_object($value)) {
                $value = self::stringifyKey($value);
            }
        }

        return json_encode($key);
    }