generated from Nodarx/template
refactor: migrate to scoped execution contexts
Signed-off-by: Sebastian Krupinski <krupinski01@gmail.com>
This commit is contained in:
@@ -11,7 +11,7 @@ namespace KTXM\ProviderImap\Console;
|
||||
|
||||
use KTXM\ProviderImap\Providers\Provider;
|
||||
use KTXM\ProviderImap\Providers\Service;
|
||||
use KTXC\SessionTenant;
|
||||
use KTXC\Context\TenantContext;
|
||||
use Symfony\Component\Console\Attribute\AsCommand;
|
||||
use Symfony\Component\Console\Command\Command;
|
||||
use Symfony\Component\Console\Input\InputArgument;
|
||||
@@ -37,7 +37,7 @@ class DisconnectCommand extends Command
|
||||
{
|
||||
public function __construct(
|
||||
private readonly Provider $provider,
|
||||
private readonly SessionTenant $sessionTenant,
|
||||
private readonly TenantContext $tenantContext,
|
||||
) {
|
||||
parent::__construct();
|
||||
}
|
||||
@@ -86,7 +86,7 @@ class DisconnectCommand extends Command
|
||||
$userId = (string) ($input->getOption('user') ?? '');
|
||||
|
||||
if ($tenantId !== '' && $userId !== '') {
|
||||
$this->sessionTenant->configureById($tenantId);
|
||||
$this->tenantContext->resolveIdentifier($tenantId);
|
||||
$services = $this->provider->serviceList($tenantId, $userId);
|
||||
|
||||
if (empty($services)) {
|
||||
@@ -130,7 +130,7 @@ class DisconnectCommand extends Command
|
||||
}
|
||||
|
||||
// ── Fetch service for display ────────────────────────────────────────
|
||||
$this->sessionTenant->configureById($tenantId);
|
||||
$this->tenantContext->resolveIdentifier($tenantId);
|
||||
$service = $this->provider->serviceFetch($tenantId, $userId, $serviceId);
|
||||
|
||||
if ($service === null) {
|
||||
|
||||
Reference in New Issue
Block a user