chore: remove retundant .env files. some additional fixes
This commit is contained in:
@@ -15,21 +15,13 @@ final readonly class RateLimiterInitializer
|
||||
{
|
||||
public function __construct(
|
||||
private Container $container
|
||||
) {
|
||||
}
|
||||
|
||||
#[Initializer]
|
||||
public function createStorageInterface(): StorageInterface
|
||||
{
|
||||
$cache = $this->container->get(Cache::class);
|
||||
|
||||
return new CacheStorage($cache);
|
||||
}
|
||||
) {}
|
||||
|
||||
#[Initializer]
|
||||
public function createRateLimiter(): RateLimiter
|
||||
{
|
||||
$storage = $this->container->get(StorageInterface::class);
|
||||
$cache = $this->container->get(Cache::class);
|
||||
$storage = new CacheStorage($cache);
|
||||
|
||||
return new RateLimiter($storage);
|
||||
}
|
||||
|
||||
@@ -7,8 +7,10 @@ namespace App\Framework\RateLimit\Storage;
|
||||
use App\Framework\Cache\Cache;
|
||||
use App\Framework\Cache\CacheKey;
|
||||
use App\Framework\Core\ValueObjects\Duration;
|
||||
use App\Framework\DI\Attributes\DefaultImplementation;
|
||||
use App\Framework\RateLimit\TokenBucket;
|
||||
|
||||
#[DefaultImplementation]
|
||||
final readonly class CacheStorage implements StorageInterface
|
||||
{
|
||||
public function __construct(
|
||||
|
||||
Reference in New Issue
Block a user