reduce boilerplate around attribute handling

This commit is contained in:
Dylan K. Taylor
2019-07-31 16:41:09 +01:00
parent dc33b9e573
commit 296061d25d
10 changed files with 43 additions and 43 deletions

View File

@ -29,7 +29,7 @@ class AttributeMap implements \ArrayAccess{
/** @var Attribute[] */
private $attributes = [];
public function addAttribute(Attribute $attribute) : void{
public function add(Attribute $attribute) : void{
$this->attributes[$attribute->getId()] = $attribute;
}
@ -38,7 +38,7 @@ class AttributeMap implements \ArrayAccess{
*
* @return Attribute|null
*/
public function getAttribute(string $id) : ?Attribute{
public function get(string $id) : ?Attribute{
return $this->attributes[$id] ?? null;
}