AttributeMap: drop ArrayAccess interface

this makes no sense because it isn't type safe and isn't used anywhere. It's just extra maintenance cost for no good reason.
This commit is contained in:
Dylan K. Taylor 2019-08-02 17:19:14 +01:00
parent c1ef5ba8ab
commit e03f918806

View File

@ -25,7 +25,7 @@ namespace pocketmine\entity;
use function array_filter;
class AttributeMap implements \ArrayAccess{
class AttributeMap{
/** @var Attribute[] */
private $attributes = [];
@ -57,29 +57,4 @@ class AttributeMap implements \ArrayAccess{
return $attribute->isSyncable() and $attribute->isDesynchronized();
});
}
public function offsetExists($offset) : bool{
return isset($this->attributes[$offset]);
}
/**
* @param string $offset
*
* @return float
*/
public function offsetGet($offset) : float{
return $this->attributes[$offset]->getValue();
}
/**
* @param string $offset
* @param float $value
*/
public function offsetSet($offset, $value) : void{
$this->attributes[$offset]->setValue($value);
}
public function offsetUnset($offset) : void{
throw new \RuntimeException("Could not unset an attribute from an attribute map");
}
}