Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. RuleWatchNode.php

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\DependencyResolver

Code

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;
}

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal