<?php

namespace MintyPHP\Service\Branding;

use MintyPHP\Service\Settings\SettingGateway;
use MintyPHP\Service\Settings\SettingServicesFactory;

class BrandingServicesFactory
{
    private ?SettingServicesFactory $settingServicesFactory = null;
    private ?SettingGateway $settingGateway = null;
    private ?BrandingLogoService $brandingLogoService = null;
    private ?BrandingFaviconService $brandingFaviconService = null;

    public function createBrandingLogoService(): BrandingLogoService
    {
        return $this->brandingLogoService ??= new BrandingLogoService();
    }

    public function createBrandingFaviconService(): BrandingFaviconService
    {
        return $this->brandingFaviconService ??= new BrandingFaviconService($this->createSettingGateway());
    }

    private function createSettingGateway(): SettingGateway
    {
        return $this->settingGateway ??= $this->settingServicesFactory()->createSettingGateway();
    }

    private function settingServicesFactory(): SettingServicesFactory
    {
        return $this->settingServicesFactory ??= new SettingServicesFactory();
    }
}
