TablerBundle icon indicating copy to clipboard operation
TablerBundle copied to clipboard

addChild() return void, docs show fluent setter

Open tacman opened this issue 1 year ago • 0 comments

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.

tacman avatar Jun 20 '24 18:06 tacman