|Traversable|null $children */ public function __construct(null|array|Traversable $children = null) { if (!$children) { return; } foreach ($children as $child) { $this->addChild($child); } } public function __toString(): string { return implode(PHP_EOL, $this->children()); } }