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. |
/** * {@inheritdoc} */ public function equivalentTo(Expression $other) { if (get_class($this) !== get_class($other)) { return false; } /* @var Selector $other */ return $this->expr->equivalentTo($other->expr); }
/** * @dataProvider getNonEquivalentCriteria */ public function testNonEquivalence(Expression $left, Expression $right) { $this->assertFalse($left->equivalentTo($right)); $this->assertFalse($right->equivalentTo($left)); }