class TreeBuilder implements NodeParentInterface
{ protected $tree;
protected $root;
public function __construct(string
$name, string
$type = 'array', NodeBuilder
$builder = null
) { $builder ??=
new NodeBuilder();
$this->root =
$builder->
node($name,
$type)->
setParent($this);
} /**
* @return NodeDefinition|ArrayNodeDefinition The root node (as an ArrayNodeDefinition when the type is 'array')
*/
public function getRootNode(): NodeDefinition|ArrayNodeDefinition
{ return $this->root;
}