src/Neutrino/Security/RateLimiter.php
public function tooManyAttempts($key, $maxAttempts, $decaySeconds = 1)
    {
        /** @var \Neutrino\Cache\CacheStrategy $cache */
        $cache = $this->{Services::CACHE};

        if ($cache->exists($this->name . $key . $this->klock, $decaySeconds)) {
            return true;
        }
        if ($this->attempts($key, $decaySeconds) >= $maxAttempts) {
            $cache->save(
                $this->name . $key . $this->klock,
                time() + ($decaySeconds),
                $decaySeconds
            );

            $this->resetAttempts($key);

            return true;
        }

        return false;
    }
public function tooManyAttempts($key, $maxAttempts, $decaySeconds = 1)
    {
        /** @var \Neutrino\Cache\CacheStrategy $cache */
        $cache = $this->{Services::CACHE};

        if ($cache->exists($this->name . $key . $this->klock, $decaySeconds)) {
            return true;
        }
        if ($this->attempts($key, $decaySeconds) >= $maxAttempts) {
            $cache->save(
                $this->name . $key . $this->klock,
                time() + ($decaySeconds),
                $decaySeconds
            );

            $this->resetAttempts($key);

            return true;
        }

        return false;
    }
Determine if the given key has been "accessed" too many times.

@param  string $key
@param  int    $maxAttempts
@param  int    $decaySeconds

@return bool