1
0
Fork 0

Ignore self references when anlaysing independent root requirements

When creating a transaction we try to identify all requirements that are
not themselves required by any other package. If a package references
itself this should not mark it as being required by another package.
pull/4989/head
Nils Adermann 2016-03-02 13:03:26 +01:00
parent 7b404c4717
commit 4af74b54e0
2 changed files with 4 additions and 5 deletions

View File

@ -165,10 +165,12 @@ class Transaction
$possibleRequires = $this->pool->whatProvides($link->getTarget(), $link->getConstraint()); $possibleRequires = $this->pool->whatProvides($link->getTarget(), $link->getConstraint());
foreach ($possibleRequires as $require) { foreach ($possibleRequires as $require) {
if ($require !== $package) {
unset($roots[$require->id]); unset($roots[$require->id]);
} }
} }
} }
}
return $roots; return $roots;
} }

View File

@ -23,10 +23,7 @@ Circular dependencies are possible between packages
{ {
"name": "regular/pkg", "name": "regular/pkg",
"version": "1.0.0", "version": "1.0.0",
"source": { "reference": "some.branch", "type": "git", "url": "" }, "source": { "reference": "some.branch", "type": "git", "url": "" }
"__dummy__require": {
"require/itself": "1.0.0"
}
} }
] ]
} }