Fixed missing getValue() implementation on CompoundTag

This commit is contained in:
Dylan K. Taylor 2017-11-21 10:52:00 +00:00
parent a39c9e8c8e
commit 0ee452773d

View File

@ -39,15 +39,25 @@ class CompoundTag extends NamedTag implements \ArrayAccess{
parent::__construct($name, $value); parent::__construct($name, $value);
} }
/**
* @return int
*/
public function getCount(){ public function getCount(){
$count = 0; return count($this->getValue());
}
/**
* @return NamedTag[]
*/
public function &getValue(){
$result = [];
foreach($this as $tag){ foreach($this as $tag){
if($tag instanceof Tag){ if($tag instanceof NamedTag){
++$count; $result[$tag->getName()] = $tag;
} }
} }
return $count; return $result;
} }
/** /**