From 5f202efa0bcf8f51f13ab073a09b42ebfb6c8f26 Mon Sep 17 00:00:00 2001 From: Andreas Schempp Date: Wed, 16 Oct 2019 13:36:28 +0200 Subject: [PATCH] Added comment why source link check is necessary --- src/Composer/Repository/BaseRepository.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/Composer/Repository/BaseRepository.php b/src/Composer/Repository/BaseRepository.php index 5ee866543..d668f43cb 100644 --- a/src/Composer/Repository/BaseRepository.php +++ b/src/Composer/Repository/BaseRepository.php @@ -68,6 +68,9 @@ abstract class BaseRepository implements RepositoryInterface if (!$invert) { $links += $package->getReplaces(); + // On forward search, check if any replaced package was required and add the replaced + // packages to the list of needles. Contrary to the cross-reference link check below, + // replaced packages are the target of links. foreach ($package->getReplaces() as $link) { foreach ($needles as $needle) { if ($link->getSource() === $needle) {