Skip to content

Commit deb6cd4

Browse files
kenjisMGatner
authored andcommitted
refactor: use array_key_first()
1 parent a7925f6 commit deb6cd4

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

system/HTTP/RequestTrait.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ public function getIPAddress(): string
6464
$proxyIPs = $this->proxyIPs ?? config('App')->proxyIPs;
6565
if (! empty($proxyIPs)) {
6666
// @phpstan-ignore-next-line
67-
if (! is_array($proxyIPs) || is_int(array_keys($proxyIPs)[0])) {
67+
if (! is_array($proxyIPs) || is_int(array_key_first($proxyIPs))) {
6868
throw new ConfigException(
6969
'You must set an array with Proxy IP address key and HTTP header name value in Config\App::$proxyIPs.'
7070
);

0 commit comments

Comments
 (0)