Last active
October 31, 2018 05:04
-
-
Save michaellopez/495f205b36647cfc7dcbd70d4de1db8e to your computer and use it in GitHub Desktop.
composer-patches 1.6.5 version of https://github.com/SebCorbin/composer-patches/commit/1cb9bacba51f8bba0c5f3f322c3bb61e4ceae974.patch
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/src/Patches.php b/src/Patches.php | |
index 70c5b83..ba01d6d 100644 | |
--- a/src/Patches.php | |
+++ b/src/Patches.php | |
@@ -8,10 +8,14 @@ | |
namespace cweagans\Composer; | |
use Composer\Composer; | |
+use Composer\DependencyResolver\DefaultPolicy; | |
+use Composer\DependencyResolver\Pool; | |
+use Composer\DependencyResolver\Request; | |
use Composer\DependencyResolver\Operation\InstallOperation; | |
use Composer\DependencyResolver\Operation\UninstallOperation; | |
use Composer\DependencyResolver\Operation\UpdateOperation; | |
use Composer\DependencyResolver\Operation\OperationInterface; | |
+use Composer\Repository\CompositeRepository; | |
use Composer\EventDispatcher\EventSubscriberInterface; | |
use Composer\IO\IOInterface; | |
use Composer\Package\AliasPackage; | |
@@ -135,7 +139,9 @@ class Patches implements PluginInterface, EventSubscriberInterface { | |
|| ($has_patches && $has_applied_patches && $tmp_patches[$package_name] !== $extra['patches_applied'])) { | |
$uninstallOperation = new UninstallOperation($package, 'Removing package so it can be re-installed and re-patched.'); | |
$this->io->write('<info>Removing package ' . $package_name . ' so that it can be re-installed and re-patched.</info>'); | |
+ $this->eventDispatcher->dispatchPackageEvent(PackageEvents::PRE_PACKAGE_UNINSTALL, $event->isDevMode(), new DefaultPolicy(), new Pool('dev'), new CompositeRepository([$package->getRepository()]), new Request(), [$uninstallOperation], $uninstallOperation); | |
$installationManager->uninstall($localRepository, $uninstallOperation); | |
+ $this->eventDispatcher->dispatchPackageEvent(PackageEvents::POST_PACKAGE_UNINSTALL, $event->isDevMode(), new DefaultPolicy(), new Pool('dev'), new CompositeRepository([$package->getRepository()]), new Request(), [$uninstallOperation], $uninstallOperation); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment