2026-02-23 12:58:19 +01:00
|
|
|
<?php
|
|
|
|
|
|
|
|
|
|
namespace MintyPHP\Service\Security;
|
|
|
|
|
|
2026-03-05 08:26:51 +01:00
|
|
|
use MintyPHP\Repository\Security\RateLimitRepositoryInterface;
|
2026-02-23 12:58:19 +01:00
|
|
|
|
|
|
|
|
class SecurityServicesFactory
|
|
|
|
|
{
|
|
|
|
|
private ?RateLimiterService $rateLimiterService = null;
|
|
|
|
|
|
2026-03-04 15:56:58 +01:00
|
|
|
public function __construct(
|
|
|
|
|
private readonly SecurityRepositoryFactory $securityRepositoryFactory
|
2026-03-05 11:17:42 +01:00
|
|
|
) {
|
|
|
|
|
}
|
2026-03-04 15:56:58 +01:00
|
|
|
|
2026-03-05 08:26:51 +01:00
|
|
|
public function createRateLimitRepository(): RateLimitRepositoryInterface
|
2026-02-23 12:58:19 +01:00
|
|
|
{
|
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());
|
|
|
|
|
}
|
|
|
|
|
}
|