1
0
Fork 0

Merge pull request #8221 from magnetik/ignore-platform-reqs-conflicts

Ignore platform reqs now handle conflict rules
pull/8252/head
Jordi Boggiano 2019-07-30 07:27:50 +02:00 committed by GitHub
commit 5de4a16115
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 2 deletions

View File

@ -233,7 +233,7 @@ class RuleSetGenerator
} }
} }
protected function addConflictRules() protected function addConflictRules($ignorePlatformReqs = false)
{ {
/** @var PackageInterface $package */ /** @var PackageInterface $package */
foreach ($this->addedPackages as $package) { foreach ($this->addedPackages as $package) {
@ -242,6 +242,10 @@ class RuleSetGenerator
continue; continue;
} }
if ($ignorePlatformReqs && preg_match(PlatformRepository::PLATFORM_PACKAGE_REGEX, $link->getTarget())) {
continue;
}
/** @var PackageInterface $possibleConflict */ /** @var PackageInterface $possibleConflict */
foreach ($this->addedPackagesByNames[$link->getTarget()] as $possibleConflict) { foreach ($this->addedPackagesByNames[$link->getTarget()] as $possibleConflict) {
$conflictMatch = $this->pool->match($possibleConflict, $link->getTarget(), $link->getConstraint(), true); $conflictMatch = $this->pool->match($possibleConflict, $link->getTarget(), $link->getConstraint(), true);
@ -362,7 +366,7 @@ class RuleSetGenerator
$this->addRulesForJobs($ignorePlatformReqs); $this->addRulesForJobs($ignorePlatformReqs);
$this->addConflictRules(); $this->addConflictRules($ignorePlatformReqs);
// Remove references to packages // Remove references to packages
$this->addedPackages = $this->addedPackagesByNames = null; $this->addedPackages = $this->addedPackagesByNames = null;