public function intersectExists(Condition $c1, Condition $c2) { if (!$c1 instanceof TitleOfMoreCharsThan || !$c2 instanceof TitleOfMoreCharsThan) { throw new ImpossibleToLookForIntersection(); } if (!$c1->isNegated() && $c2->isNegated()) { return $c2->getThreshold() > $c1->getThreshold(); } elseif ($c1->isNegated() && !$c2->isNegated()) { return $c1->getThreshold() > $c2->getThreshold(); } return true; }
public function equal(Condition $c1, Condition $c2) { if (!$c1 instanceof TitleOfMoreCharsThan || !$c2 instanceof TitleOfMoreCharsThan) { throw new IncomparableConditions(); } return $c1->isNegated() == $c2->isNegated() && $c1->getThreshold() == $c2->getThreshold(); }
public function testRemovingNegation() { $this->c->negate(); $this->c->removeNegation(); $this->assertFalse($this->c->isNegated()); }