1
0
Fork 0

Remove useless parsing of constraint from package name

pull/11120/head
Jordi Boggiano 2022-10-13 10:55:39 +02:00
parent 8618f004f7
commit c9b1a2e70b
No known key found for this signature in database
GPG Key ID: 7BBD42C429EC80BC
1 changed files with 2 additions and 8 deletions

View File

@ -89,14 +89,8 @@ abstract class BaseDependencyCommand extends BaseCommand
$installedRepo = new InstalledRepository($repos);
// Parse package name and constraint
[$needle, $textConstraint] = array_pad(
explode(':', $input->getArgument(self::ARGUMENT_PACKAGE)),
2,
$input->hasArgument(self::ARGUMENT_CONSTRAINT) ? $input->getArgument(self::ARGUMENT_CONSTRAINT) : '*'
);
if (!$input->hasArgument(self::ARGUMENT_CONSTRAINT)) {
$textConstraint = '*';
}
$needle = $input->getArgument(self::ARGUMENT_PACKAGE);
$textConstraint = $input->hasArgument(self::ARGUMENT_CONSTRAINT) ? $input->getArgument(self::ARGUMENT_CONSTRAINT) : '*';
// Find packages that are or provide the requested package first
$packages = $installedRepo->findPackagesWithReplacersAndProviders($needle);