Skip to content

Commit 4c76208

Browse files
#32676: Mark classes and interfaces as API part 7 - revert changes in RemoteAddress.php
1 parent 9765d1d commit 4c76208

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

lib/internal/Magento/Framework/HTTP/PhpEnvironment/RemoteAddress.php

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@
44
* See COPYING.txt for license details.
55
*/
66

7-
declare(strict_types=1);
8-
97
namespace Magento\Framework\HTTP\PhpEnvironment;
108

119
use Magento\Framework\App\RequestInterface;
@@ -104,9 +102,9 @@ function (string $ip) {
104102
return !in_array(trim($ip), $this->trustedProxies, true);
105103
}
106104
);
107-
$remoteAddress = trim((string) array_pop($ipList));
105+
$remoteAddress = trim(array_pop($ipList));
108106
} else {
109-
$remoteAddress = trim((string) reset($ipList));
107+
$remoteAddress = trim(reset($ipList));
110108
}
111109

112110
return $remoteAddress ?: null;
@@ -125,7 +123,7 @@ function (string $ip) {
125123
public function getRemoteAddress(bool $ipToLong = false)
126124
{
127125
if ($this->remoteAddress !== null) {
128-
return $ipToLong && $this->remoteAddress ? ip2long($this->remoteAddress) : $this->remoteAddress;
126+
return $ipToLong ? ip2long($this->remoteAddress) : $this->remoteAddress;
129127
}
130128

131129
$remoteAddress = $this->readAddress();
@@ -144,7 +142,7 @@ public function getRemoteAddress(bool $ipToLong = false)
144142

145143
$this->remoteAddress = $remoteAddress;
146144

147-
return $ipToLong && $this->remoteAddress ? ip2long($this->remoteAddress) : $this->remoteAddress;
145+
return $ipToLong ? ip2long($this->remoteAddress) : $this->remoteAddress;
148146
}
149147

150148
/**

0 commit comments

Comments
 (0)