From 65a47192518327e455797921002e9e6d8d9e3d5a Mon Sep 17 00:00:00 2001 From: Jordi Boggiano Date: Thu, 28 Apr 2016 22:02:22 +0100 Subject: [PATCH] Add output in why-not for when a package requires a platform package and it is not found, fixes #5259 --- src/Composer/Repository/BaseRepository.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/Composer/Repository/BaseRepository.php b/src/Composer/Repository/BaseRepository.php index 56c402345..b4382b1b1 100644 --- a/src/Composer/Repository/BaseRepository.php +++ b/src/Composer/Repository/BaseRepository.php @@ -121,7 +121,7 @@ abstract class BaseRepository implements RepositoryInterface if (in_array($rootReq->getTarget(), $pkg->getNames()) && !$rootReq->getConstraint()->matches($link->getConstraint())) { $results[] = array($package, $link, false); $results[] = array($rootPackage, $rootReq, false); - break 2; + continue 3; } } $results[] = array($package, $link, false); @@ -132,7 +132,11 @@ abstract class BaseRepository implements RepositoryInterface } } - break; + continue 2; + } + + if (preg_match(PlatformRepository::PLATFORM_PACKAGE_REGEX, $link->getTarget())) { + $results[] = array($package, new Link($package->getName(), $link->getTarget(), null, 'requires', $link->getPrettyConstraint().' but it is missing'), false); } } }