original_string: 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;
      }
code: 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;
      }
code_tokens: 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 ; }
docstring: 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.
docstring_tokens: Checks if the target file should be added based on the given mode .