/** * Checks if adding the event would cause the rate limit to be exceeded * @return Boolean */ protected function exceedsRateLimit() : Boolean { $count = $this->repository->count($this->event); $cost = $this->event->getCost(); $limit = $this->limit->getLimit(); return $count->add($cost)->greaterThan($limit); }