Make sure there's always a constraint
parent
912aecb666
commit
10555ecff3
|
@ -294,10 +294,6 @@ class PoolBuilder
|
||||||
$this->io->writeError('<warning>Dependency "'.$require.'" is also a root requirement. Package has not been listed as an update argument, so keeping locked at old version. Use --with-all-dependencies to include root dependencies.</warning>');
|
$this->io->writeError('<warning>Dependency "'.$require.'" is also a root requirement. Package has not been listed as an update argument, so keeping locked at old version. Use --with-all-dependencies to include root dependencies.</warning>');
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (null === $this->loadedNames[$require] || null === $linkConstraint) {
|
|
||||||
unset($this->loadedNames[$require]);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!$this->loadedNames[$require]->matches($linkConstraint)) {
|
if (!$this->loadedNames[$require]->matches($linkConstraint)) {
|
||||||
$loadNames[$require] = MultiConstraint::create(array($this->loadedNames[$require], $linkConstraint), false);
|
$loadNames[$require] = MultiConstraint::create(array($this->loadedNames[$require], $linkConstraint), false);
|
||||||
unset($this->loadedNames[$require]);
|
unset($this->loadedNames[$require]);
|
||||||
|
@ -313,7 +309,7 @@ class PoolBuilder
|
||||||
if (isset($this->loadedNames[$replace]) && isset($this->skippedLoad[$replace])) {
|
if (isset($this->loadedNames[$replace]) && isset($this->skippedLoad[$replace])) {
|
||||||
if ($request->getUpdateAllowTransitiveRootDependencies() || !$this->isRootRequire($request, $this->skippedLoad[$replace])) {
|
if ($request->getUpdateAllowTransitiveRootDependencies() || !$this->isRootRequire($request, $this->skippedLoad[$replace])) {
|
||||||
$this->unfixPackage($request, $replace);
|
$this->unfixPackage($request, $replace);
|
||||||
$loadNames[$replace] = null;
|
$loadNames[$replace] = $link->getConstraint();
|
||||||
} elseif (!$request->getUpdateAllowTransitiveRootDependencies() && $this->isRootRequire($request, $replace) && !isset($this->updateAllowWarned[$replace])) {
|
} elseif (!$request->getUpdateAllowTransitiveRootDependencies() && $this->isRootRequire($request, $replace) && !isset($this->updateAllowWarned[$replace])) {
|
||||||
$this->updateAllowWarned[$replace] = true;
|
$this->updateAllowWarned[$replace] = true;
|
||||||
$this->io->writeError('<warning>Dependency "'.$replace.'" is also a root requirement. Package has not been listed as an update argument, so keeping locked at old version. Use --with-all-dependencies to include root dependencies.</warning>');
|
$this->io->writeError('<warning>Dependency "'.$replace.'" is also a root requirement. Package has not been listed as an update argument, so keeping locked at old version. Use --with-all-dependencies to include root dependencies.</warning>');
|
||||||
|
|
|
@ -17,6 +17,7 @@ use Composer\Package\PackageInterface;
|
||||||
use Composer\Package\RootAliasPackage;
|
use Composer\Package\RootAliasPackage;
|
||||||
use Composer\Repository\LockArrayRepository;
|
use Composer\Repository\LockArrayRepository;
|
||||||
use Composer\Semver\Constraint\ConstraintInterface;
|
use Composer\Semver\Constraint\ConstraintInterface;
|
||||||
|
use Composer\Semver\Constraint\EmptyConstraint;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author Nils Adermann <naderman@naderman.de>
|
* @author Nils Adermann <naderman@naderman.de>
|
||||||
|
@ -55,7 +56,7 @@ class Request
|
||||||
public function requireName($packageName, ConstraintInterface $constraint = null)
|
public function requireName($packageName, ConstraintInterface $constraint = null)
|
||||||
{
|
{
|
||||||
$packageName = strtolower($packageName);
|
$packageName = strtolower($packageName);
|
||||||
$this->requires[$packageName] = $constraint;
|
$this->requires[$packageName] = $constraint ? $constraint : new EmptyConstraint();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -13,6 +13,7 @@
|
||||||
namespace Composer\Package;
|
namespace Composer\Package;
|
||||||
|
|
||||||
use Composer\Semver\Constraint\ConstraintInterface;
|
use Composer\Semver\Constraint\ConstraintInterface;
|
||||||
|
use Composer\Semver\Constraint\EmptyConstraint;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Represents a link between two packages, represented by their names
|
* Represents a link between two packages, represented by their names
|
||||||
|
@ -59,7 +60,7 @@ class Link
|
||||||
{
|
{
|
||||||
$this->source = strtolower($source);
|
$this->source = strtolower($source);
|
||||||
$this->target = strtolower($target);
|
$this->target = strtolower($target);
|
||||||
$this->constraint = $constraint;
|
$this->constraint = $constraint ? $constraint : new EmptyConstraint();
|
||||||
$this->description = $description;
|
$this->description = $description;
|
||||||
$this->prettyConstraint = $prettyConstraint;
|
$this->prettyConstraint = $prettyConstraint;
|
||||||
}
|
}
|
||||||
|
@ -89,7 +90,7 @@ class Link
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return ConstraintInterface|null
|
* @return ConstraintInterface
|
||||||
*/
|
*/
|
||||||
public function getConstraint()
|
public function getConstraint()
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue