mirror of
https://github.com/composer/composer
synced 2025-05-09 00:22:53 +00:00
Request jobs replaced by root require / fixed package
The only type of request job remaining was "install" which is really a root requirement. The only other kind of input for the solver is now a set of fixed packages. Rules have been updated to account for only two kinds of former job reason: FIXED or ROOT_REQUIRE. The job property has always been redundant and has been removed, since reasonData suffices. Problem reasons are always rules, so the unnecessary wrapping in an array has been removed. We now only ever generate a single rule per root require or fixed package, so there is no need for the solver to special handle disabling "jobs" anymore, the rule can just be disabled as usual. For consistency special handling of rules for jobs in problems has been integrated into the rule class like all other rule reasons. As part of this change the error message for root requirements has been improved a bit to make it clearer where the package installation request came from. The word job has also been removed from operations, which are called operations, not jobs.
This commit is contained in:
parent
921a97457d
commit
5bdc0fc9c5
33 changed files with 271 additions and 365 deletions
|
@ -30,13 +30,13 @@ class RequestTest extends TestCase
|
|||
$repo->addPackage($foobar);
|
||||
|
||||
$request = new Request();
|
||||
$request->install('foo');
|
||||
$request->require('foo');
|
||||
|
||||
$this->assertEquals(
|
||||
array(
|
||||
array('cmd' => 'install', 'packageName' => 'foo', 'constraint' => null),
|
||||
'foo' => null,
|
||||
),
|
||||
$request->getJobs()
|
||||
$request->getRequires()
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -52,13 +52,13 @@ class RequestTest extends TestCase
|
|||
$repo2->addPackage($foo2);
|
||||
|
||||
$request = new Request();
|
||||
$request->install('foo', $constraint = $this->getVersionConstraint('=', '1'));
|
||||
$request->require('foo', $constraint = $this->getVersionConstraint('=', '1'));
|
||||
|
||||
$this->assertEquals(
|
||||
array(
|
||||
array('cmd' => 'install', 'packageName' => 'foo', 'constraint' => $constraint),
|
||||
'foo' => $constraint,
|
||||
),
|
||||
$request->getJobs()
|
||||
$request->getRequires()
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue