mirror of
https://github.com/php-curl-class/php-curl-class.git
synced 2026-08-30 12:14:36 +00:00
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:
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user