function Installer::uninstall
Overrides LibraryInstaller::uninstall
File
-
vendor/
composer/ installers/ src/ Composer/ Installers/ Installer.php, line 164
Class
Namespace
Composer\InstallersCode
public function uninstall(InstalledRepositoryInterface $repo, PackageInterface $package) {
$installPath = $this->getPackageBasePath($package);
$io = $this->io;
$outputStatus = function () use ($io, $installPath) {
$io->write(sprintf('Deleting %s - %s', $installPath, !file_exists($installPath) ? '<comment>deleted</comment>' : '<error>not deleted</error>'));
};
$promise = parent::uninstall($repo, $package);
// Composer v2 might return a promise here
if ($promise instanceof PromiseInterface) {
return $promise->then($outputStatus);
}
// If not, execute the code right away as parent::uninstall executed synchronously (composer v1, or v2 without async)
$outputStatus();
return null;
}