public function __construct($capacity, Rate $rate, Storage $storage) { if ($capacity <= 0) { throw new \InvalidArgumentException("Capacity should be greater than 0."); } $this->capacity = $capacity; $this->rate = $rate; $this->storage = $storage; $this->tokenConverter = new TokenConverter($rate); }