1
0
Fork 0

Exclude platform require/provides from InstalledVersions as concrete ones are also not listed

pull/8860/head
Jordi Boggiano 2020-05-01 13:10:50 +02:00
parent 0071bc1ec0
commit 56811b4c8f
No known key found for this signature in database
GPG Key ID: 7BBD42C429EC80BC
1 changed files with 8 additions and 0 deletions

View File

@ -155,6 +155,10 @@ class FilesystemRepository extends WritableArrayRepository
// add provided/replaced packages
foreach ($packages as $package) {
foreach ($package->getReplaces() as $replace) {
// exclude platform replaces as when they are really there we can not check for their presence
if (preg_match(PlatformRepository::PLATFORM_PACKAGE_REGEX, $replace->getTarget())) {
continue;
}
$replaced = $replace->getPrettyConstraint();
if ($replaced === 'self.version') {
$replaced = $package->getPrettyVersion();
@ -164,6 +168,10 @@ class FilesystemRepository extends WritableArrayRepository
}
}
foreach ($package->getProvides() as $provide) {
// exclude platform provides as when they are really there we can not check for their presence
if (preg_match(PlatformRepository::PLATFORM_PACKAGE_REGEX, $provide->getTarget())) {
continue;
}
$provided = $provide->getPrettyConstraint();
if ($provided === 'self.version') {
$provided = $package->getPrettyVersion();