Skip to content

Commit 1292b5f

Browse files
committed
Updates have a slightly different interface than installs
1 parent 8f55fda commit 1292b5f

1 file changed

Lines changed: 8 additions & 1 deletion

File tree

src/lkwdwrd/Composer/MULoaderPlugin.php

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,8 +88,15 @@ public static function getSubscribedEvents() {
8888
* @return void
8989
*/
9090
public function overridePluginTypes( $event ) {
91+
// Get the package being worked on.
92+
$operation = $event->getOperation();
93+
if ( $operation instanceof \Composer\DependencyResolver\Operation\UpdateOperation ) {
94+
$package = $operation->getInitialPackage();
95+
} else {
96+
$package = $operation->getPackage();
97+
}
98+
9199
// Only act on wordpress-plugin types
92-
$package = $event->getOperation()->getPackage();
93100
if ( 'wordpress-plugin' !== $package->getType() ) {
94101
return;
95102
}

0 commit comments

Comments
 (0)