private function canAddSymlink($source, $target, $mode)
    {
        if (!is_readable($source)) {
            throw new \RuntimeException(
                sprintf('Installation source "%s" does not exist or is not readable', $source)
            );
        }

        if (file_exists($target)) {
            // Target link already exists and is correct, do nothing
            if (is_link($target) && $source === realpath($target)) {
                return false;
            }

            if (!$this->canAddTarget($target, $mode)) {
                return false;
            }
        }

        return true;
    }