You are here

public function Installer::uninstall in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 vendor/composer/installers/src/Composer/Installers/Installer.php \Composer\Installers\Installer::uninstall()

File

vendor/composer/installers/src/Composer/Installers/Installer.php, line 93

Class

Installer

Namespace

Composer\Installers

Code

public function uninstall(InstalledRepositoryInterface $repo, PackageInterface $package) {
  if (!$repo
    ->hasPackage($package)) {
    throw new \InvalidArgumentException('Package is not installed: ' . $package);
  }
  $repo
    ->removePackage($package);
  $installPath = $this
    ->getInstallPath($package);
  $this->io
    ->write(sprintf('Deleting %s - %s', $installPath, $this->filesystem
    ->removeDirectory($installPath) ? '<comment>deleted</comment>' : '<error>not deleted</error>'));
}