function RuleWatchGraph::moveWatch
Moves a rule node from one watch chain to another
The rule node's watched literals are updated accordingly.
Parameters
int $fromLiteral A literal the node used to watch:
int $toLiteral A literal the node should watch now:
RuleWatchNode $node The rule node to be moved:
1 call to RuleWatchGraph::moveWatch()
- RuleWatchGraph::propagateLiteral in vendor/
composer/ composer/ src/ Composer/ DependencyResolver/ RuleWatchGraph.php - Propagates a decision on a literal to all rules watching the literal
File
-
vendor/
composer/ composer/ src/ Composer/ DependencyResolver/ RuleWatchGraph.php, line 157
Class
- RuleWatchGraph
- The RuleWatchGraph efficiently propagates decisions to other rules
Namespace
Composer\DependencyResolverCode
protected function moveWatch(int $fromLiteral, int $toLiteral, RuleWatchNode $node) : void {
if (!isset($this->watchChains[$toLiteral])) {
$this->watchChains[$toLiteral] = new RuleWatchChain();
}
$node->moveWatch($fromLiteral, $toLiteral);
$this->watchChains[$fromLiteral]
->remove();
$this->watchChains[$toLiteral]
->unshift($node);
}