public static function unique($array)
    {
        $suitable = true;
        foreach ($array as $k => &$v) {
            if (is_array($v)) {
                $v = self::unique($v);
            } elseif (!is_int($k)) {
                $suitable = false;
            }
        }

        return $suitable ? self::uniqueFlat($array) : $array;
    }