Browse Source

Fix case insensitivity of remove command, fixes #5973

Jordi Boggiano 8 years ago
parent
commit
01885777f3
1 changed files with 4 additions and 4 deletions
  1. 4 4
      src/Composer/Command/RemoveCommand.php

+ 4 - 4
src/Composer/Command/RemoveCommand.php

@@ -84,19 +84,19 @@ EOT
         foreach (array('require', 'require-dev') as $linkType) {
             if (isset($composer[$linkType])) {
                 foreach ($composer[$linkType] as $name => $version) {
-                    $composer[$linkType][strtolower($name)] = $version;
+                    $composer[$linkType][strtolower($name)] = $name;
                 }
             }
         }
 
         foreach ($packages as $package) {
             if (isset($composer[$type][$package])) {
-                $json->removeLink($type, $package);
+                $json->removeLink($type, $composer[$type][$package]);
             } elseif (isset($composer[$altType][$package])) {
-                $io->writeError('<warning>'.$package.' could not be found in '.$type.' but it is present in '.$altType.'</warning>');
+                $io->writeError('<warning>'.$composer[$altType][$package].' could not be found in '.$type.' but it is present in '.$altType.'</warning>');
                 if ($io->isInteractive()) {
                     if ($io->askConfirmation('Do you want to remove it from '.$altType.' [<comment>yes</comment>]? ', true)) {
-                        $json->removeLink($altType, $package);
+                        $json->removeLink($altType, $composer[$altType][$package]);
                     }
                 }
             } else {