Skip to content

Commit 6692300

Browse files
committed
Update Server.php
1 parent eceb12a commit 6692300

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/VerifierServer/Server.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -102,15 +102,15 @@ class Server {
102102

103103
public function __construct(
104104
protected string $addr,
105-
protected ?int $port = null
105+
protected int $port = 0
106106
) {
107107
if (empty($port) && !str_contains($addr, ':')) {
108108
throw new Exception("Invalid address: $addr. Port is required.");
109109
}
110-
111-
if (str_contains($addr, ':')) {
112-
[$this->addr, $port] = explode(':', $addr);
113-
$this->port = (int)$port;
110+
if (str_contains($this->addr, ':')) {
111+
$array = explode(':', $this->addr);
112+
$this->addr = $array[0];
113+
$this->port = (int) $array[1];
114114
}
115115
}
116116

0 commit comments

Comments
 (0)