src/Server/Throttle/CachePoolThrottle.php
public function logRequest(APIRequest $request): void
    {
        $item = $this->cacheItemPool->getItem($this->deriveCacheKey($request));

        if($requestCount = $item->get()) {
            $item->set($requestCount + 1);
        } else {
            $item->set(1)->expiresAfter($this->perXSeconds);
        }

        $this->cacheItemPool->save($item);
    }
public function logRequest(APIRequest $request): void
    {
        $item = $this->cacheItemPool->getItem($this->deriveCacheKey($request));

        if($requestCount = $item->get()) {
            $item->set($requestCount + 1);
        } else {
            $item->set(1)->expiresAfter($this->perXSeconds);
        }

        $this->cacheItemPool->save($item);
    }
public function logRequest ( APIRequest $ request ) : void { $ item = $ this -> cacheItemPool -> getItem ( $ this -> deriveCacheKey ( $ request ) ) ; if ( $ requestCount = $ item -> get ( ) ) { $ item -> set ( $ requestCount + 1 ) ; } else { $ item -> set ( 1 ) -> expiresAfter ( $ this -> perXSeconds ) ; } $ this -> cacheItemPool -> save ( $ item ) ; }
Log that a request took place
@param \LunixREST\Server\APIRequest\APIRequest $request
Log that a request took place