LEtudiant\Composer\Installer\SharedPackageInstaller::uninstall PHP Method

uninstall() public method

public uninstall ( Composer\Repository\InstalledRepositoryInterface $repo, Composer\Package\PackageInterface $package )
$repo Composer\Repository\InstalledRepositoryInterface
$package Composer\Package\PackageInterface
    public function uninstall(InstalledRepositoryInterface $repo, PackageInterface $package)
    {
        if ($this->isSourceDirUnused($package) && $this->io->askConfirmation("The package version <info>" . $package->getPrettyName() . "</info> " . "(<fg=yellow>" . $package->getPrettyVersion() . "</fg=yellow>) seems to be unused." . PHP_EOL . 'Do you want to <fg=red>delete the source folder</fg=red> ? [y/n] (default: no) : ', false)) {
            $this->packageDataManager->setPackageInstallationSource($package);
            parent::uninstall($repo, $package);
        } else {
            $this->binaryInstaller->removeBinaries($package);
            $repo->removePackage($package);
        }
        $this->packageDataManager->removePackageUsage($package);
        $this->removePackageVendorSymlink($package);
    }

Usage Example

 /**
  * @param InstalledRepositoryInterface $repo
  * @param PackageInterface             $package
  *
  * @throws FilesystemException
  */
 public function uninstall(InstalledRepositoryInterface $repo, PackageInterface $package)
 {
     if ($package->isDev()) {
         if (!$repo->hasPackage($package)) {
             throw new \InvalidArgumentException('Package is not installed : ' . $package->getPrettyName());
         }
         $this->symlinkInstaller->uninstall($repo, $package);
     } else {
         $this->defaultInstaller->uninstall($repo, $package);
     }
 }
All Usage Examples Of LEtudiant\Composer\Installer\SharedPackageInstaller::uninstall