instances added god may help
This commit is contained in:
21
lib/Service/Security/SecurityServicesFactory.php
Normal file
21
lib/Service/Security/SecurityServicesFactory.php
Normal file
@@ -0,0 +1,21 @@
|
||||
<?php
|
||||
|
||||
namespace MintyPHP\Service\Security;
|
||||
|
||||
use MintyPHP\Repository\Security\RateLimitRepository;
|
||||
|
||||
class SecurityServicesFactory
|
||||
{
|
||||
private ?RateLimitRepository $rateLimitRepository = null;
|
||||
private ?RateLimiterService $rateLimiterService = null;
|
||||
|
||||
public function createRateLimitRepository(): RateLimitRepository
|
||||
{
|
||||
return $this->rateLimitRepository ??= new RateLimitRepository();
|
||||
}
|
||||
|
||||
public function createRateLimiterService(): RateLimiterService
|
||||
{
|
||||
return $this->rateLimiterService ??= new RateLimiterService($this->createRateLimitRepository());
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user