src/Core/Cache/RateLimiter.php
public function hit()
    {
        if (!$this->getCache()->has($this->getIdentifier())) {
            $ttl = $this->getDecay() * 60;
            $expiry = DBDatetime::now()->getTimestamp() + $ttl;
            $this->getCache()->set($this->getIdentifier() . '-timer', $expiry, $ttl);
        } else {
            $expiry = $this->getCache()->get($this->getIdentifier() . '-timer');
            $ttl = $expiry - DBDatetime::now()->getTimestamp();
        }
        $this->getCache()->set($this->getIdentifier(), $this->getNumAttempts() + 1, $ttl);
        return $this;
    }
public function hit()
    {
        if (!$this->getCache()->has($this->getIdentifier())) {
            $ttl = $this->getDecay() * 60;
            $expiry = DBDatetime::now()->getTimestamp() + $ttl;
            $this->getCache()->set($this->getIdentifier() . '-timer', $expiry, $ttl);
        } else {
            $expiry = $this->getCache()->get($this->getIdentifier() . '-timer');
            $ttl = $expiry - DBDatetime::now()->getTimestamp();
        }
        $this->getCache()->set($this->getIdentifier(), $this->getNumAttempts() + 1, $ttl);
        return $this;
    }
public function hit ( ) { if ( ! $ this -> getCache ( ) -> has ( $ this -> getIdentifier ( ) ) ) { $ ttl = $ this -> getDecay ( ) * 60 ; $ expiry = DBDatetime :: now ( ) -> getTimestamp ( ) + $ ttl ; $ this -> getCache ( ) -> set ( $ this -> getIdentifier ( ) . '-timer' , $ expiry , $ ttl ) ; } else { $ expiry = $ this -> getCache ( ) -> get ( $ this -> getIdentifier ( ) . '-timer' ) ; $ ttl = $ expiry - DBDatetime :: now ( ) -> getTimestamp ( ) ; } $ this -> getCache ( ) -> set ( $ this -> getIdentifier ( ) , $ this -> getNumAttempts ( ) + 1 , $ ttl ) ; return $ this ; }
Store a hit in the rate limit cache

@return $this
Store a hit in the rate limit cache