Skip to content

Commit 26e61d2

Browse files
committed
inline variable
no need to create the temporary `$ipAddress` variable, we can access the array offset directly from the function.
1 parent 5a00a8b commit 26e61d2

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

src/Symfony/Component/HttpFoundation/Request.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -750,9 +750,7 @@ public function getClientIps(): array
750750
*/
751751
public function getClientIp(): ?string
752752
{
753-
$ipAddresses = $this->getClientIps();
754-
755-
return $ipAddresses[0];
753+
return $this->getClientIps()[0];
756754
}
757755

758756
/**

0 commit comments

Comments
 (0)