public static function appendLines(string $filename, array $lines, string $separator = "\n"): int
    {
        if (self::exist($filename)) {
            $existingLines = self::getLines($filename);
            $lines = array_merge($existingLines, $lines);
            return self::putLines($filename, $lines, $separator);
        }
        return self::putLines($filename, $lines, $separator);
    }