instances added god may help

This commit is contained in:
2026-02-23 12:58:19 +01:00
parent 25370a1a55
commit 99db252f60
290 changed files with 9858 additions and 4914 deletions

View File

@@ -0,0 +1,44 @@
<?php
namespace MintyPHP\Service\Mail;
use MintyPHP\Repository\Mail\MailLogRepository;
use MintyPHP\Service\Settings\SettingGateway;
use MintyPHP\Service\Settings\SettingServicesFactory;
class MailServicesFactory
{
private ?MailLogRepository $mailLogRepository = null;
private ?SettingServicesFactory $settingServicesFactory = null;
private ?SettingGateway $settingGateway = null;
private ?MailService $mailService = null;
private ?MailLogService $mailLogService = null;
public function createMailLogRepository(): MailLogRepository
{
return $this->mailLogRepository ??= new MailLogRepository();
}
public function createMailService(): MailService
{
return $this->mailService ??= new MailService(
$this->createMailLogRepository(),
$this->createSettingGateway()
);
}
public function createMailLogService(): MailLogService
{
return $this->mailLogService ??= new MailLogService($this->createMailLogRepository());
}
private function createSettingGateway(): SettingGateway
{
return $this->settingGateway ??= $this->settingServicesFactory()->createSettingGateway();
}
private function settingServicesFactory(): SettingServicesFactory
{
return $this->settingServicesFactory ??= new SettingServicesFactory();
}
}