Fix issue in remove command when allow-plugins is not present at all, fixes #10629
parent
dec123770f
commit
ca3b874414
|
@ -235,8 +235,8 @@ EOT
|
|||
$composer->getEventDispatcher()->dispatch($commandEvent->getName(), $commandEvent);
|
||||
|
||||
$allowPlugins = $composer->getConfig()->get('allow-plugins');
|
||||
$removedPlugins = array_intersect(array_keys($allowPlugins), $packages);
|
||||
if (!$dryRun && count($removedPlugins) !== 0) {
|
||||
$removedPlugins = is_array($allowPlugins) ? array_intersect(array_keys($allowPlugins), $packages) : [];
|
||||
if (!$dryRun && count($removedPlugins) > 0) {
|
||||
if (count($allowPlugins) === count($removedPlugins)) {
|
||||
$json->removeConfigSetting('allow-plugins');
|
||||
} else {
|
||||
|
|
Loading…
Reference in New Issue