Fixed oversight not caught by phpstan tsk tsk.

This commit is contained in:
flash 2024-04-10 23:36:28 +00:00
parent c40f264755
commit 339f9d3701
3 changed files with 11 additions and 11 deletions

View file

@ -1 +1 @@
0.2404.102325 0.2404.102336

View file

@ -26,14 +26,14 @@ class MemcachedProviderLegacy extends MemcachedProvider {
foreach($providerInfo->getEndPoints() as $endPointInfo) { foreach($providerInfo->getEndPoints() as $endPointInfo) {
if($endPointInfo[0] instanceof UnixEndPoint) { if($endPointInfo[0] instanceof UnixEndPoint) {
$host = 'unix://' . $endPointInfo->getPath(); $host = 'unix://' . $endPointInfo[0]->getPath();
$port = 0; $port = 0;
} elseif($endPointInfo[0] instanceof DnsEndPoint) { } elseif($endPointInfo[0] instanceof DnsEndPoint) {
$host = $endPointInfo->getHost(); $host = $endPointInfo[0]->getHost();
$port = $endPointInfo->getPort(); $port = $endPointInfo[0]->getPort();
} elseif($endPointInfo[0] instanceof IPEndPoint) { } elseif($endPointInfo[0] instanceof IPEndPoint) {
$host = $endPointInfo->getAddress()->getCleanAddress(); $host = $endPointInfo[0]->getAddress()->getCleanAddress();
$port = $endPointInfo->getPort(); $port = $endPointInfo[0]->getPort();
} else throw new InvalidArgumentException('One of the servers specified in $providerInfo is not a supported endpoint.'); } else throw new InvalidArgumentException('One of the servers specified in $providerInfo is not a supported endpoint.');
$this->memcache->addServer($host, $port, $this->persistent, $endPointInfo[1]); $this->memcache->addServer($host, $port, $this->persistent, $endPointInfo[1]);

View file

@ -25,14 +25,14 @@ class MemcachedProviderModern extends MemcachedProvider {
foreach($providerInfo->getEndPoints() as $endPointInfo) { foreach($providerInfo->getEndPoints() as $endPointInfo) {
if($endPointInfo[0] instanceof UnixEndPoint) { if($endPointInfo[0] instanceof UnixEndPoint) {
$host = $endPointInfo->getPath(); $host = $endPointInfo[0]->getPath();
$port = 0; $port = 0;
} elseif($endPointInfo[0] instanceof DnsEndPoint) { } elseif($endPointInfo[0] instanceof DnsEndPoint) {
$host = $endPointInfo->getHost(); $host = $endPointInfo[0]->getHost();
$port = $endPointInfo->getPort(); $port = $endPointInfo[0]->getPort();
} elseif($endPointInfo[0] instanceof IPEndPoint) { } elseif($endPointInfo[0] instanceof IPEndPoint) {
$host = $endPointInfo->getAddress()->getCleanAddress(); $host = $endPointInfo[0]->getAddress()->getCleanAddress();
$port = $endPointInfo->getPort(); $port = $endPointInfo[0]->getPort();
} else throw new InvalidArgumentException('One of the servers specified in $providerInfo is not a supported endpoint.'); } else throw new InvalidArgumentException('One of the servers specified in $providerInfo is not a supported endpoint.');
$this->memcached->addServer($host, $port, $endPointInfo[1]); $this->memcached->addServer($host, $port, $endPointInfo[1]);