equivalentTo() public method

Returns whether this expression is logically equivalent to another expression.
public equivalentTo ( Webmozart\Expression\Expression $other ) : boolean
$other Webmozart\Expression\Expression Some expression.
return boolean Returns `true` if the expressions are logically equivalent and `false` otherwise.
Exemplo n.º 1
0
 /**
  * {@inheritdoc}
  */
 public function equivalentTo(Expression $other)
 {
     if (get_class($this) !== get_class($other)) {
         return false;
     }
     /* @var Selector $other */
     return $this->expr->equivalentTo($other->expr);
 }
Exemplo n.º 2
0
 /**
  * @dataProvider getNonEquivalentCriteria
  */
 public function testNonEquivalence(Expression $left, Expression $right)
 {
     $this->assertFalse($left->equivalentTo($right));
     $this->assertFalse($right->equivalentTo($left));
 }