$v) { if (property_exists($this, $k)) $this->$k = $v; else trigger_error(self::class.'::__construct - unrecognized option: ' . $k); } if (!$this->template) trigger_error(self::class.'::__construct - initialized without template', E_USER_WARNING); if (!$this->id) trigger_error(self::class.'::__construct - initialized without HTMLNode#id to reference', E_USER_WARNING); } public function &iterate() : \Generator { reset($this->groups); foreach ($this->groups as $idx => &$group) yield $idx => $group; } public function addGroup(array $group) : void { $this->groups[] = $group; } public function jsonSerialize() : array { $result = []; foreach ($this as $prop => $val) if ($val !== null && $prop[0] != '_') $result[$prop] = $val; return $result; } public function __toString() : string { return "new Summary(".Util::toJSON($this).");\n"; } } ?>