AttributeMap: be aware of possible NULL offset in ArrayAccess

reported by phpstan 0.12.17
This commit is contained in:
Dylan K. Taylor 2020-03-18 12:59:01 +00:00
parent 517f9a3c3a
commit d4dc1c8a0c

View File

@ -71,10 +71,13 @@ class AttributeMap implements \ArrayAccess{
}
/**
* @param int $offset
* @param float $value
* @param int|null $offset
* @param float $value
*/
public function offsetSet($offset, $value) : void{
if($offset === null){
throw new \InvalidArgumentException("Array push syntax is not supported");
}
$this->attributes[$offset]->setValue($value);
}