* Jordi Boggiano * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Composer\DependencyResolver; use Composer\Package\LinkConstraint\LinkConstraintInterface; /** * @author Nils Adermann */ class Request { protected $jobs; protected $pool; public function __construct(Pool $pool) { $this->pool = $pool; } public function install($packageName, LinkConstraintInterface $constraint = null) { $this->addJob(strtolower($packageName), 'install', $constraint); } public function update($packageName, LinkConstraintInterface $constraint = null) { $this->addJob(strtolower($packageName), 'update', $constraint); } public function remove($packageName, LinkConstraintInterface $constraint = null) { $this->addJob(strtolower($packageName), 'remove', $constraint); } protected function addJob($packageName, $cmd, LinkConstraintInterface $constraint = null) { $packages = $this->pool->whatProvides(strtolower($packageName), $constraint); $this->jobs[] = array( 'packages' => $packages, 'cmd' => $cmd, 'packageName' => strtolower($packageName), ); } public function getJobs() { return $this->jobs; } }