public function contains(Rule $other) { if ($other instanceof NoRule) { return true; } if ($other instanceof NumberRule) { return $this->check($other->getNumber()); } if ($other instanceof static) { return $this->checkMin($other->min) && $this->checkMax($other->max); } return false; }