/**
  * The reason why we call it 'primary' is that we issue errors only from this rule (if both rules are failed).
  *
  * @param RuleInterface $primary
  * @param RuleInterface $secondary
  */
 public function __construct(RuleInterface $primary, RuleInterface $secondary)
 {
     $this->primary = $primary;
     $this->secondary = $secondary;
     $secondary->setParentRule($this);
     $primary->setParentRule($this);
 }
 /**
  * @param RuleInterface $first
  * @param RuleInterface $second
  */
 public function __construct(RuleInterface $first, RuleInterface $second)
 {
     $this->first = $first;
     $this->second = $second;
     $first->setParentRule($this);
     $second->setParentRule($this);
 }
 /**
  * @param callable      $condition
  * @param RuleInterface $onTrue
  * @param RuleInterface $onFalse
  */
 public function __construct(callable $condition, RuleInterface $onTrue, RuleInterface $onFalse)
 {
     $this->condition = $condition;
     $this->onTrue = $onTrue;
     $this->onFalse = $onFalse;
     $onTrue->setParentRule($this);
     $onFalse->setParentRule($this);
 }
 /**
  * @param array         $rules
  * @param RuleInterface $unlisted
  */
 public function __construct(array $rules, RuleInterface $unlisted)
 {
     parent::__construct($rules);
     $this->unlisted = $unlisted;
     $this->unlisted->setParentRule($this);
 }
 /**
  * @param RuleInterface $rule
  */
 public function __construct(RuleInterface $rule)
 {
     $rule->setParentRule($this);
     $this->rule = $rule;
 }