refactor(arch): enforce gateway compliance and remove service-wrapping gateways

This commit is contained in:
2026-03-13 11:31:33 +01:00
parent 082fa4c9a5
commit 892da0048d
96 changed files with 1117 additions and 1060 deletions

View File

@@ -2,6 +2,8 @@
namespace MintyPHP\Service\Import\Profile;
use MintyPHP\Service\User\UserAccountService;
class UserImportProfile implements ImportProfileInterface
{
/**
@@ -9,8 +11,10 @@ class UserImportProfile implements ImportProfileInterface
*/
private ?array $allowedLocales = null;
public function __construct(private readonly UserImportGateway $gateway)
{
public function __construct(
private readonly UserImportGateway $gateway,
private readonly UserAccountService $userAccountService
) {
}
public function key(): string
@@ -203,7 +207,7 @@ class UserImportProfile implements ImportProfileInterface
$input['active'] = null;
}
$result = $this->gateway->createUserFromAdmin($input, (int) ($context['current_user_id'] ?? 0));
$result = $this->userAccountService->createFromAdmin($input, (int) ($context['current_user_id'] ?? 0));
if (!($result['ok'] ?? false)) {
$errors = $result['errors'] ?? [];
$message = is_array($errors) && isset($errors[0]) ? (string) $errors[0] : t('User can not be registered');