/** * Calculate the number of remaining attempts. * * @param string $key * @param int $maxAttempts * @param int|null $retryAfter * @return int */ protected function calculateRemainingAttempts($key, $maxAttempts, $retryAfter = null) { if (!is_null($retryAfter)) { return 0; } return $this->limiter->retriesLeft($key, $maxAttempts); }
/** * Determine how many retries left. * * @return int */ public function retriesLeft() { return $this->cacheLimiter->retriesLeft($this->getUniqueLoginKey(), $this->maxLoginAttempts()); }