public function __construct(array $options, $enabled = true) { $this->enabled = $enabled; parent::__construct($options); }
/** * Get the remaining limit before the consumer is rate limited. * * @return int */ public function getRemainingLimit() { $remaining = $this->throttle->getLimit() - $this->retrieve('requests'); return $remaining > 0 ? $remaining : 0; }