From e03f918806354d1fd18523a6fbd98c6c409d3038 Mon Sep 17 00:00:00 2001 From: "Dylan K. Taylor" Date: Fri, 2 Aug 2019 17:19:14 +0100 Subject: [PATCH] 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. --- src/entity/AttributeMap.php | 27 +-------------------------- 1 file changed, 1 insertion(+), 26 deletions(-) diff --git a/src/entity/AttributeMap.php b/src/entity/AttributeMap.php index c04223938..70575c869 100644 --- a/src/entity/AttributeMap.php +++ b/src/entity/AttributeMap.php @@ -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"); - } }