LEtudiant\Composer\Util\SymlinkFilesystem::removeSymlink PHP Method

    public function removeSymlink($symlinkPath)
    {
        if (is_link($symlinkPath)) {
            if (!$this->unlink($symlinkPath)) {
                // @codeCoverageIgnoreStart
                throw new \RuntimeException('Unable to remove the symlink : ' . $symlinkPath);
                // @codeCoverageIgnoreEnd
            }
            return true;
        }
        return false;
    }

Usage Example

 /**
  * @param PackageInterface $package
  *
  * @throws FilesystemException
  */
 protected function removePackageVendorSymlink(PackageInterface $package)
 {
     if ($this->config->isSymlinkEnabled() && $this->filesystem->removeSymlink($this->getPackageVendorSymlink($package))) {
         $this->io->write(array('  - Deleting symlink for <info>' . $package->getPrettyName() . '</info> ' . '(<fg=yellow>' . $package->getPrettyVersion() . '</fg=yellow>)', ''));
         $symlinkParentDirectory = dirname($this->getPackageVendorSymlink($package));
         $this->filesystem->removeEmptyDirectory($symlinkParentDirectory);
     }
 }
All Usage Examples Of LEtudiant\Composer\Util\SymlinkFilesystem::removeSymlink