getDisjuncts() public method

Returns the disjuncts of the disjunction.
public getDisjuncts ( ) : Webmozart\Expression\Expression[]
return Webmozart\Expression\Expression[] The disjuncts.
 private function traverseDisjunction(OrX $expr)
 {
     $disjuncts1 = $expr->getDisjuncts();
     $disjuncts2 = array();
     foreach ($disjuncts1 as $disjunct) {
         if ($disjunct = $this->traverse($disjunct)) {
             $disjuncts2[] = $disjunct;
         }
     }
     if ($disjuncts1 === $disjuncts2) {
         return $expr;
     }
     return $disjuncts2 ? new OrX($disjuncts2) : null;
 }
示例#2
0
 /**
  * @dataProvider \Webmozart\Expression\Tests\ExprTest::getMethodTests
  */
 public function testOr($method, $args, $expected)
 {
     // tested separately
     if ('true' === $method || 'false' === $method) {
         return;
     }
     if ('is' === substr($method, 0, 2)) {
         $method = substr($method, 2);
     }
     $method = 'or' . ucfirst($method);
     $disjunction1 = new OrX();
     $disjunction2 = call_user_func_array(array($disjunction1, $method), $args);
     $this->assertEquals(array(), $disjunction1->getDisjuncts());
     $this->assertEquals(array($expected), $disjunction2->getDisjuncts());
 }