function RuleWatchNode::__construct
Creates a new node watching the first and second literals of the rule.
Parameters
Rule $rule The rule to wrap:
File
-
vendor/
composer/ composer/ src/ Composer/ DependencyResolver/ RuleWatchNode.php, line 37
Class
- RuleWatchNode
- Wrapper around a Rule which keeps track of the two literals it watches
Namespace
Composer\DependencyResolverCode
public function __construct(Rule $rule) {
$this->rule = $rule;
$literals = $rule->getLiterals();
$literalCount = \count($literals);
$this->watch1 = $literalCount > 0 ? $literals[0] : 0;
$this->watch2 = $literalCount > 1 ? $literals[1] : 0;
}