Skip to content

Commit 7592b7c

Browse files
authored
Add port as a separate member variable
Now that port isn't a part of the hostname, move it to be it's own member variable
1 parent ceaaeba commit 7592b7c

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

src/Elasticsearch/Connections/Connection.php

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,11 @@ class Connection implements ConnectionInterface
5858
* @var string|null
5959
*/
6060
protected $path;
61+
62+
/**
63+
* @var int
64+
*/
65+
protected $port;
6166

6267
/**
6368
* @var LoggerInterface
@@ -133,8 +138,11 @@ public function __construct(
133138
if (isset($hostDetails['path']) === true) {
134139
$path = $hostDetails['path'];
135140
}
141+
$port = $hostDetails['port'];
142+
136143
$this->host = $host;
137144
$this->path = $path;
145+
$this->port = $port;
138146
$this->log = $log;
139147
$this->trace = $trace;
140148
$this->connectionParams = $connectionParams;
@@ -511,6 +519,9 @@ public function getHost()
511519
{
512520
return $this->host;
513521
}
522+
523+
/**
524+
514525
515526
/**
516527
* @return null|string
@@ -530,6 +541,14 @@ public function getPath()
530541
{
531542
return $this->path;
532543
}
544+
545+
/**
546+
* @return int
547+
*/
548+
public function getPort()
549+
{
550+
return $this->port;
551+
}
533552

534553
/**
535554
* @param array $request

0 commit comments

Comments
 (0)