Skip to content

Commit

Permalink
inline variable
Browse files Browse the repository at this point in the history
no need to create the temporary `$ipAddress` variable, we can access the array offset directly from the function.
  • Loading branch information
browner12 committed May 8, 2024
1 parent 5a00a8b commit 26e61d2
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions src/Symfony/Component/HttpFoundation/Request.php
Original file line number Diff line number Diff line change
Expand Up @@ -750,9 +750,7 @@ public function getClientIps(): array
*/
public function getClientIp(): ?string
{
$ipAddresses = $this->getClientIps();

return $ipAddresses[0];
return $this->getClientIps()[0];
}

/**
Expand Down

0 comments on commit 26e61d2

Please sign in to comment.