diff --git a/src/Composer/Command/BumpCommand.php b/src/Composer/Command/BumpCommand.php index a87a65e1c..4570ce2a3 100644 --- a/src/Composer/Command/BumpCommand.php +++ b/src/Composer/Command/BumpCommand.php @@ -153,6 +153,10 @@ EOT } if (count($packagesFilter) > 0) { + // support proxied args from the update command that contain constraints together with the package names + $packagesFilter = array_map(function ($constraint) { + return Preg::replace('{[:= ].+}', '', $constraint); + }, $packagesFilter); $pattern = BasePackage::packageNamesToRegexp(array_unique(array_map('strtolower', $packagesFilter))); foreach ($tasks as $key => $reqs) { foreach ($reqs as $pkgName => $link) { diff --git a/tests/Composer/Test/Command/BumpCommandTest.php b/tests/Composer/Test/Command/BumpCommandTest.php index 8e8161dcf..e83fb86fd 100644 --- a/tests/Composer/Test/Command/BumpCommandTest.php +++ b/tests/Composer/Test/Command/BumpCommandTest.php @@ -149,7 +149,7 @@ class BumpCommandTest extends TestCase 'dev/pkg' => '~2.0', ], ], - ['packages' => ['first/pkg', 'dev/*']], + ['packages' => ['first/pkg:3.0.1', 'dev/*']], [ 'require' => [ 'first/pkg' => '^2.3.4',