2026-02-23 12:58:19 +01:00
|
|
|
<?php
|
|
|
|
|
|
|
|
|
|
namespace MintyPHP\Service\Security;
|
|
|
|
|
|
|
|
|
|
use MintyPHP\Repository\Security\RateLimitRepository;
|
|
|
|
|
|
|
|
|
|
class SecurityServicesFactory
|
|
|
|
|
{
|
|
|
|
|
private ?RateLimiterService $rateLimiterService = null;
|
|
|
|
|
|
2026-03-04 15:56:58 +01:00
|
|
|
public function __construct(
|
|
|
|
|
private readonly SecurityRepositoryFactory $securityRepositoryFactory
|
|
|
|
|
) {}
|
|
|
|
|
|
2026-02-23 12:58:19 +01:00
|
|
|
public function createRateLimitRepository(): RateLimitRepository
|
|
|
|
|
{
|
2026-03-04 15:56:58 +01:00
|
|
|
return $this->securityRepositoryFactory->createRateLimitRepository();
|
2026-02-23 12:58:19 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public function createRateLimiterService(): RateLimiterService
|
|
|
|
|
{
|
|
|
|
|
return $this->rateLimiterService ??= new RateLimiterService($this->createRateLimitRepository());
|
|
|
|
|
}
|
|
|
|
|
}
|