From 190d263c74773e855ecc2d854766ec3963db448e Mon Sep 17 00:00:00 2001 From: Nils Adermann Date: Tue, 11 Sep 2018 14:40:37 +0200 Subject: [PATCH] Fix logic for composer repository's optional acceptable callable filter --- src/Composer/Repository/ComposerRepository.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Composer/Repository/ComposerRepository.php b/src/Composer/Repository/ComposerRepository.php index cec2ae948..ea583ede6 100644 --- a/src/Composer/Repository/ComposerRepository.php +++ b/src/Composer/Repository/ComposerRepository.php @@ -169,7 +169,7 @@ class ComposerRepository extends ArrayRepository implements ConfigurableReposito foreach ($this->getProviderNames() as $providerName) { if ($name === $providerName) { - $candidates = $this->whatProvides($providerName); // TODO what is the point of this? + $candidates = $this->whatProvides($providerName); foreach ($candidates as $package) { if ($name === $package->getName()) { $pkgConstraint = new Constraint('==', $package->getVersion()); @@ -394,7 +394,7 @@ class ComposerRepository extends ArrayRepository implements ConfigurableReposito } } } else { - if (!$bypassFilters && (!$isPackageAcceptableCallable || !call_user_func($isPackageAcceptableCallable, strtolower($version['name']), VersionParser::parseStability($version['version'])))) { + if (!$bypassFilters && $isPackageAcceptableCallable && !call_user_func($isPackageAcceptableCallable, strtolower($version['name']), VersionParser::parseStability($version['version']))) { continue; }