public static function write(string $file = '', string $data = '', bool $doAppend = false): bool
    {
        $result = false;
        $file = static::normalizePath($file);
        if (static::verifyPath($file) && Directory::create(\dirname($file))) {
            $flags = $doAppend ? FILE_APPEND : 0;
            $flags |= static::$writeLocks ? LOCK_EX : 0;

            $result = @\file_put_contents($file, $data, $flags) !== false;
            @\chmod($file, static::$newFileMode);
        }
        return $result;
    }