private function canAddTarget($target, $mode)
    {
        // Mode is set to ignore existing targets
        if ($mode === self::DUPLICATE_IGNORE) {
            return false;
        }

        // Error if we're not allowed to overwrite or can't remove the existing target
        if ($mode !== self::DUPLICATE_OVERWRITE || !$this->filesystem->remove($target)) {
            throw new \RuntimeException(sprintf('Installation target "%s" already exists', $target));
        }

        return true;
    }
private function canAddTarget($target, $mode)
    {
        // Mode is set to ignore existing targets
        if ($mode === self::DUPLICATE_IGNORE) {
            return false;
        }

        // Error if we're not allowed to overwrite or can't remove the existing target
        if ($mode !== self::DUPLICATE_OVERWRITE || !$this->filesystem->remove($target)) {
            throw new \RuntimeException(sprintf('Installation target "%s" already exists', $target));
        }

        return true;
    }
private function canAddTarget ( $ target , $ mode ) { // Mode is set to ignore existing targets if ( $ mode === self :: DUPLICATE_IGNORE ) { return false ; } // Error if we're not allowed to overwrite or can't remove the existing target if ( $ mode !== self :: DUPLICATE_OVERWRITE || ! $ this -> filesystem -> remove ( $ target ) ) { throw new \ RuntimeException ( sprintf ( 'Installation target "%s" already exists' , $ target ) ) ; } return true ; }
Checks if the target file should be added based on the given mode.

@param string $target The target path.

@param int    $mode   The overwrite mode.

@return bool

@throws \RuntimeException If target exists and can not or must not be removed.
Checks if the target file should be added based on the given mode .