TablerBundle
TablerBundle copied to clipboard
addChild() return void, docs show fluent setter
This fails, because addChild() return void
public function addChild(MenuItemInterface $child): void
{
$child->setParent($this);
$this->children[] = $child;
}
$blog->addChild(
new MenuItemModel('ChildOneItemId', 'ChildOneDisplayName', 'child_1_route', [], 'fas fa-rss-square')
)->addChild(
new MenuItemModel('ChildTwoItemId', 'ChildTwoDisplayName', 'child_2_route')
);
https://github.com/kevinpapst/TablerBundle/blob/main/docs/menu.md
Obviously, the docs could be fixed, but I'd prefer that the addChild was fluent.