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 equal(Condition $c1, Condition $c2) { if (!$c1 instanceof Difficulty || !$c2 instanceof Difficulty) { throw new IncomparableConditions(); } return $c1->isEasy() === $c2->isEasy() && $c1->isNormal() === $c2->isNormal() && $c1->isHard() === $c2->isHard(); }
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; }
protected function setIsTrueInImplReturnedValueTo($trueOrFalse) { $this->c->method('isTrueInImpl')->will($this->returnValue($trueOrFalse)); }