Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

addChild() return void, docs show fluent setter #199

Closed
tacman opened this issue Jun 20, 2024 · 1 comment
Closed

addChild() return void, docs show fluent setter #199

tacman opened this issue Jun 20, 2024 · 1 comment

Comments

@tacman
Copy link
Contributor

tacman commented Jun 20, 2024

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.

@kevinpapst
Copy link
Owner

Thanks for pointing out 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants