<?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());
    }
}
