Page Menu
Home
DevCentral
Search
Configure Global Search
Log In
Files
F3920470
D1625.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
2 KB
Referenced Files
None
Subscribers
None
D1625.diff
View Options
diff --git a/src/HTTP/Requests/RemoteAddress.php b/src/HTTP/Requests/RemoteAddress.php
--- a/src/HTTP/Requests/RemoteAddress.php
+++ b/src/HTTP/Requests/RemoteAddress.php
@@ -30,7 +30,7 @@
return $this->remoteAddress !== "";
}
- public function getOne () : string {
+ public function getClientAddress () : string {
if (strpos($this->remoteAddress, ',') === false) {
// We only have one value, it's the IP
return $this->remoteAddress;
diff --git a/src/HTTP/Requests/WithRemoteAddress.php b/src/HTTP/Requests/WithRemoteAddress.php
--- a/src/HTTP/Requests/WithRemoteAddress.php
+++ b/src/HTTP/Requests/WithRemoteAddress.php
@@ -19,7 +19,7 @@
* @return string the remote address
*/
public static function getRemoteAddress () : string {
- return RemoteAddress::fromServer()->getOne();
+ return RemoteAddress::fromServer()->getClientAddress();
}
}
diff --git a/tests/HTTP/Requests/RemoteAddressTest.php b/tests/HTTP/Requests/RemoteAddressTest.php
--- a/tests/HTTP/Requests/RemoteAddressTest.php
+++ b/tests/HTTP/Requests/RemoteAddressTest.php
@@ -13,30 +13,30 @@
///
/**
- * @covers \Keruald\OmniTools\HTTP\Requests\RemoteAddress::getOne
+ * @covers \Keruald\OmniTools\HTTP\Requests\RemoteAddress::getClientAddress
* @covers \Keruald\OmniTools\HTTP\Requests\RemoteAddress::getAll
* @covers \Keruald\OmniTools\HTTP\Requests\RemoteAddress::has
*/
public function testEmptyRequest () : void {
$address = new RemoteAddress;
- $this->assertEmpty($address->getOne());
+ $this->assertEmpty($address->getClientAddress());
$this->assertEmpty($address->getAll());
$this->assertFalse($address->has());
}
/**
- * @covers \Keruald\OmniTools\HTTP\Requests\RemoteAddress::getOne
+ * @covers \Keruald\OmniTools\HTTP\Requests\RemoteAddress::getClientAddress
* @dataProvider provideTenZeroZeroThreeHeaderValues
*/
public function testGetOne (string $value) : void {
$address = new RemoteAddress($value);
- $this->assertEquals('10.0.0.3', $address->getOne());
+ $this->assertEquals('10.0.0.3', $address->getClientAddress());
}
/**
- * @covers \Keruald\OmniTools\HTTP\Requests\RemoteAddress::getOne
+ * @covers \Keruald\OmniTools\HTTP\Requests\RemoteAddress::getClientAddress
* @dataProvider provideTenZeroZeroThreeHeaderValues
*/
public function testGetAll (string $value) : void {
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sat, Dec 21, 15:53 (10 h, 14 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2309633
Default Alt Text
D1625.diff (2 KB)
Attached To
Mode
D1625: Rename RemoteAddress::getOne to getClientAddress
Attached
Detach File
Event Timeline
Log In to Comment