public function createFromDriveAndAtoms(
        $atoms,
        $drive = null,
        $isAbsolute = null,
        $isAnchored = null,
        $hasTrailingSeparator = null
    ) {
        if (null === $isAnchored) {
            $isAnchored = false;
        }
        if (null === $isAbsolute) {
            $isAbsolute = null !== $drive && !$isAnchored;
        }

        if ($isAbsolute && $isAnchored) {
            throw new InvalidPathStateException(
                'Absolute Windows paths cannot be anchored.'
            );
        }

        if ($isAbsolute) {
            return new AbsoluteWindowsPath(
                $drive,
                $atoms,
                $hasTrailingSeparator
            );
        }

        return new RelativeWindowsPath(
            $atoms,
            $drive,
            $isAnchored,
            $hasTrailingSeparator
        );
    }