Beispiel #1
0
 protected function renderAssertion(Assertion $assert)
 {
     $kind = $assert->getKind();
     if ($assert->value instanceof Operand) {
         return $kind . '(' . $this->renderOperand($assert->value) . ')';
     }
     $combinator = $assert->mode === Assertion::MODE_UNION ? "|" : '&';
     $results = [];
     foreach ($assert->value as $child) {
         $results[] = $this->renderAssertion($child);
     }
     return $kind . '(' . implode($combinator, $results) . ')';
 }
Beispiel #2
0
 /**
  * @param Assertion[]|Operand $value
  */
 public function __construct($value)
 {
     parent::__construct($value, self::MODE_INTERSECTION);
 }