Fix psalm error (#1027)

ERROR: PossiblyNullArrayOffset - ../src/Curl/CaseInsensitiveArray.php:183:16 - Cannot access value on variable $this->keys using possibly null offset array-key|null (see https://psalm.dev/125)
        return $this->keys[$key] ?? $key;
This commit is contained in:
Zach Borboa
2025-12-10 20:30:55 -05:00
committed by GitHub
parent ce146416a5
commit a91a932382
+5 -1
View File
@@ -180,7 +180,11 @@ class CaseInsensitiveArray implements \ArrayAccess, \Countable, \Iterator
public function key()
{
$key = key($this->data);
return $this->keys[$key] ?? $key;
if ($key === null) {
return null;
} else {
return $this->keys[$key] ?? $key;
}
}
/**