diff --git a/src/Api/ThrottleMiddleware.php b/src/Api/ThrottleMiddleware.php index 505e109..1cc0222 100644 --- a/src/Api/ThrottleMiddleware.php +++ b/src/Api/ThrottleMiddleware.php @@ -3,8 +3,11 @@ namespace EmotionHero\Api; use Exception; +use Symfony\Component\HttpFoundation\JsonResponse; use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpKernel\HttpKernelInterface; +use TokenBucket\Storage\PDO; +use TokenBucket\TokenBucket; /** * Description of ThrottleMiddleware @@ -45,7 +48,7 @@ class ThrottleMiddleware implements HttpKernelInterface if($limit_requests) { - $storage = new PDOStorage($this->options['pdo']); + $storage = new PDO($this->options['pdo']); // Define the bucket $bucket_options = array( 'capacity' => $tokens,