generated from Nodarx/template
refactor: use split socket location class
Signed-off-by: Sebastian Krupinski <krupinski01@gmail.com>
This commit is contained in:
@@ -150,12 +150,11 @@ class ConnectCommand extends Command
|
||||
// ── Build service object ────────────────────────────────────────────
|
||||
|
||||
$location = new ServiceLocation(
|
||||
host: $host,
|
||||
port: $port > 0 ? $port : 993,
|
||||
encryption: $encryption,
|
||||
verifyPeer: !$noVerify,
|
||||
verifyPeerName: !$noVerify,
|
||||
allowSelfSigned: $noVerify,
|
||||
inboundHost: $host,
|
||||
inboundPort: $port > 0 ? $port : 993,
|
||||
inboundEncryption: $encryption,
|
||||
inboundVerifyPeer: !$noVerify,
|
||||
inboundVerifyHost: !$noVerify,
|
||||
);
|
||||
|
||||
$identity = (new ServiceIdentityBasic())->jsonDeserialize([
|
||||
|
||||
@@ -139,7 +139,7 @@ class DisconnectCommand extends Command
|
||||
}
|
||||
|
||||
$label = $service->getLabel() ?? $serviceId;
|
||||
$host = $service->getLocation()?->getHost() ?? 'unknown';
|
||||
$host = $service->getLocation()?->getInboundHost() ?? 'unknown';
|
||||
|
||||
$io->title('Disconnect IMAP Service');
|
||||
$io->definitionList(
|
||||
|
||||
@@ -151,7 +151,7 @@ class DiscoverCommand extends Command
|
||||
/** @var array<string, ServiceLocation> $choiceMap */
|
||||
$choiceMap = [];
|
||||
foreach ($candidates as $c) {
|
||||
$label = sprintf('%s : %d [%s]', $c->getHost(), $c->getPort(), $encLabel($c->getEncryption()));
|
||||
$label = sprintf('%s : %d [%s]', $c->getInboundHost(), $c->getInboundPort(), $encLabel($c->getInboundEncryption()));
|
||||
$choiceMap[$label] = $c;
|
||||
}
|
||||
|
||||
@@ -170,9 +170,9 @@ class DiscoverCommand extends Command
|
||||
|
||||
$io->success('Server selected:');
|
||||
$io->definitionList(
|
||||
['Host' => $location->getHost()],
|
||||
['Port' => (string) $location->getPort()],
|
||||
['Encryption' => $encLabel($location->getEncryption())],
|
||||
['Host' => $location->getInboundHost()],
|
||||
['Port' => (string) $location->getInboundPort()],
|
||||
['Encryption' => $encLabel($location->getInboundEncryption())],
|
||||
);
|
||||
|
||||
if (!$save) {
|
||||
|
||||
@@ -308,7 +308,7 @@ class TestCommand extends Command
|
||||
return 'unknown';
|
||||
}
|
||||
|
||||
return sprintf('%s://%s:%d', $location->getEncryption(), $location->getHost(), $location->getPort());
|
||||
return sprintf('%s://%s:%d', $location->getInboundEncryption(), $location->getInboundHost(), $location->getInboundPort());
|
||||
}
|
||||
|
||||
private function formatSender(Message $message): string
|
||||
|
||||
Reference in New Issue
Block a user