Skip to content

Commit ff287af

Browse files
committed
minor #54869 [HttpFoundation] inline variable (browner12)
This PR was merged into the 7.2 branch. Discussion ---------- [HttpFoundation] inline variable | Q | A | ------------- | --- | Branch? | 7.1 | Bug fix? | no | New feature? | no <!-- please update src/**/CHANGELOG.md files --> | Deprecations? | no <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files --> | Issues | NA <!-- prefix each issue number with "Fix #", no need to create an issue if none exists, explain below instead --> | License | MIT no need to create the temporary `$ipAddress` variable, we can access the array offset directly from the function. Commits ------- 26e61d2f82 inline variable
2 parents f9c54a6 + 8107917 commit ff287af

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

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)