getTokens() публичный Метод

This is a purely informative method. Use this method if you are interested in the amount of remaining tokens. Those tokens could be consumed instantly. This method will not consume any token. Use {@link consume()} to do so. This method will never return more than the capacity of the bucket.
public getTokens ( ) : integer
Результат integer amount of currently available tokens
 /**
  * After waiting longer than the complete refill period on an empty bucket,
  * getTokens() should return the capacity of the bucket.
  *
  * @test
  */
 public function getTokensShouldReturnCapacityAfterWaitingLongerThanRefillPeriod()
 {
     $rate = new Rate(1, Rate::SECOND);
     $bucket = new TokenBucket(10, $rate, new SingleProcessStorage());
     $bucket->bootstrap(0);
     sleep(11);
     $this->assertEquals(10, $bucket->getTokens());
 }