Merge pull request #12231 from ThomasLandauer/patch-1
Adding explicit message to `why-not` if package is already installedpull/12284/head
commit
34c16ad169
|
@ -126,6 +126,9 @@ abstract class BaseDependencyCommand extends BaseCommand
|
||||||
$extraNotice = ' (version provided by config.platform)';
|
$extraNotice = ' (version provided by config.platform)';
|
||||||
}
|
}
|
||||||
$this->getIO()->writeError('<info>Package "'.$needle.' '.$textConstraint.'" found in version "'.$matchedPackage->getPrettyVersion().'"'.$extraNotice.'.</info>');
|
$this->getIO()->writeError('<info>Package "'.$needle.' '.$textConstraint.'" found in version "'.$matchedPackage->getPrettyVersion().'"'.$extraNotice.'.</info>');
|
||||||
|
} elseif ($inverted) {
|
||||||
|
$this->getIO()->write('<comment>Package "'.$needle.'" '.$matchedPackage->getPrettyVersion().' is already installed! To find out why, run `composer why '.$needle.'`</comment>');
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Include replaced packages for inverted lookups as they are then the actual starting point to consider
|
// Include replaced packages for inverted lookups as they are then the actual starting point to consider
|
||||||
|
|
|
@ -464,11 +464,10 @@ OUTPUT
|
||||||
0
|
0
|
||||||
];
|
];
|
||||||
|
|
||||||
yield 'there is no installed package depending on the package in versions not matching a specific version' => [
|
yield 'Package is already installed!' => [
|
||||||
['package' => 'vendor1/package1', 'version' => '^1.3'],
|
['package' => 'vendor1/package1', 'version' => '^1.3'],
|
||||||
<<<OUTPUT
|
<<<OUTPUT
|
||||||
There is no installed package depending on "vendor1/package1" in versions not matching ^1.3
|
Package "vendor1/package1" 1.3.0 is already installed! To find out why, run `composer why vendor1/package1`
|
||||||
Not finding what you were looking for? Try calling `composer require "vendor1/package1:^1.3" --dry-run` to get another view on the problem.
|
|
||||||
OUTPUT
|
OUTPUT
|
||||||
,
|
,
|
||||||
0
|
0
|
||||||
|
|
Loading…
Reference in New Issue