original_string: protected function removeCopies($targetRoot, array $pathMap)
      {
          if (empty($pathMap)) {
              return;
          }
  
          $actions = [];
  
          // Check the file map first and make sure we only remove our own symlinks.
          foreach ($pathMap as $targetPath) {
              $target = $this->filesystem->normalizePath($targetRoot . '/' . $targetPath);
  
              if (!file_exists($target)) {
                  continue;
              }
  
              $actions[] = $target;
          }
  
          // Remove the symlinks if everything is ok.
          foreach ($actions as $target) {
              $this->logRemove($target);
  
              $this->filesystem->unlink($target);
  
              $this->removeEmptyDirectories(dirname($target), $targetRoot);
          }
      }
code: protected function removeCopies($targetRoot, array $pathMap)
      {
          if (empty($pathMap)) {
              return;
          }
  
          $actions = [];
  
          // Check the file map first and make sure we only remove our own symlinks.
          foreach ($pathMap as $targetPath) {
              $target = $this->filesystem->normalizePath($targetRoot . '/' . $targetPath);
  
              if (!file_exists($target)) {
                  continue;
              }
  
              $actions[] = $target;
          }
  
          // Remove the symlinks if everything is ok.
          foreach ($actions as $target) {
              $this->logRemove($target);
  
              $this->filesystem->unlink($target);
  
              $this->removeEmptyDirectories(dirname($target), $targetRoot);
          }
      }
code_tokens: protected function removeCopies ( $ targetRoot , array $ pathMap ) { if ( empty ( $ pathMap ) ) { return ; } $ actions = [ ] ; // Check the file map first and make sure we only remove our own symlinks. foreach ( $ pathMap as $ targetPath ) { $ target = $ this -> filesystem -> normalizePath ( $ targetRoot . '/' . $ targetPath ) ; if ( ! file_exists ( $ target ) ) { continue ; } $ actions [ ] = $ target ; } // Remove the symlinks if everything is ok. foreach ( $ actions as $ target ) { $ this -> logRemove ( $ target ) ; $ this -> filesystem -> unlink ( $ target ) ; $ this -> removeEmptyDirectories ( dirname ( $ target ) , $ targetRoot ) ; } }
docstring: Removes copies from a map of relative file paths.
  Key is the relative path to composer package, whereas "value" is relative to Contao root.
  
  @param string $targetRoot The target directory.
  
  @param array  $pathMap    The path mapping.
  
  @return void
docstring_tokens: Removes copies from a map of relative file paths . Key is the relative path to composer package whereas value is relative to Contao root .