refactor: migrate to scoped execution contexts

Signed-off-by: Sebastian <krupinski01@gmail.com>
This commit is contained in:
2026-07-27 00:50:43 -04:00
parent 75d034f478
commit 436197fbfe
+6 -6
View File
@@ -7,8 +7,8 @@ namespace KTXM\Mail\Controllers;
use InvalidArgumentException;
use KTXC\Http\Response\JsonResponse;
use KTXC\Http\Response\Response;
use KTXC\SessionIdentity;
use KTXC\SessionTenant;
use KTXC\Context\IdentityContextInterface;
use KTXC\Context\TenantContextInterface;
use KTXF\Controller\ControllerAbstract;
use KTXF\Routing\Attributes\AuthenticatedRoute;
use KTXM\Mail\CompositionManager;
@@ -18,8 +18,8 @@ use Throwable;
final class CompositionController extends ControllerAbstract {
public function __construct(
private readonly SessionTenant $tenantIdentity,
private readonly SessionIdentity $userIdentity,
private readonly TenantContextInterface $tenantContext,
private readonly IdentityContextInterface $identityContext,
private readonly CompositionManager $compositionManager,
private readonly LoggerInterface $logger,
) {}
@@ -31,8 +31,8 @@ final class CompositionController extends ControllerAbstract {
string|null $operation = null,
array|null $data = null,
): Response {
$tenantId = $this->tenantIdentity->identifier();
$userId = $this->userIdentity->identifier();
$tenantId = $this->tenantContext->identifier();
$userId = $this->identityContext->identifier();
try {
if ($operation === null) {