From 4dad9fa6ef1f4b4b7ef9960e36d3ac817a44797d Mon Sep 17 00:00:00 2001 From: Nils Adermann Date: Sun, 22 May 2011 23:54:48 +0200 Subject: [PATCH] Adding support for LinkConstraints to the solver requests. Constraints are directly passed on to the pool's whatProvides method which returns a set of packages that satisfy name and constraint conditions. --- src/Composer/DependencyResolver/Request.php | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/Composer/DependencyResolver/Request.php b/src/Composer/DependencyResolver/Request.php index a0223065b..fb4022e15 100644 --- a/src/Composer/DependencyResolver/Request.php +++ b/src/Composer/DependencyResolver/Request.php @@ -25,24 +25,24 @@ class Request $this->pool = $pool; } - public function install($packageName) + public function install($packageName, LinkConstraintInterface $constraint = null) { - $this->addJob($packageName, 'install'); + $this->addJob($packageName, $constraint, 'install'); } - public function update($packageName) + public function update($packageName, LinkConstraintInterface $constraint = null) { - $this->addJob($packageName, 'update'); + $this->addJob($packageName, $constraint, 'update'); } - public function remove($packageName) + public function remove($packageName, LinkConstraintInterface $constraint = null) { - $this->addJob($packageName, 'remove'); + $this->addJob($packageName, $constraint, 'remove'); } - protected function addJob($packageName, $cmd) + protected function addJob($packageName, LinkConstraintInterface $constraint, $cmd) { - $packages = $this->pool->whatProvides($packageName); + $packages = $this->pool->whatProvides($packageName, $constraint); $this->jobs[] = array( 'packages' => $packages,