mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-06-17 00:44:08 +00:00
AttributeMap: be aware of possible NULL offset in ArrayAccess
reported by phpstan 0.12.17
This commit is contained in:
parent
517f9a3c3a
commit
d4dc1c8a0c
@ -71,10 +71,13 @@ class AttributeMap implements \ArrayAccess{
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param int $offset
|
* @param int|null $offset
|
||||||
* @param float $value
|
* @param float $value
|
||||||
*/
|
*/
|
||||||
public function offsetSet($offset, $value) : void{
|
public function offsetSet($offset, $value) : void{
|
||||||
|
if($offset === null){
|
||||||
|
throw new \InvalidArgumentException("Array push syntax is not supported");
|
||||||
|
}
|
||||||
$this->attributes[$offset]->setValue($value);
|
$this->attributes[$offset]->setValue($value);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user