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;
    }
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;
    }
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 ; }
Check if the source exists, is readable and shall get symlink'ed to the target.

@param string $source The source path.
@param string $target The target path.
@param int    $mode   The duplicate file handling mode.

@return bool

@throws \RuntimeException When the source is not readable.
Check if the source exists is readable and shall get symlink ed to the target .