public function isExpanded($currentUrl)
    {
        if (!$this->subnodes instanceof Collection) {
            return false;
        }

        return $this
            ->subnodes
            ->exists(function ($_, NodeInterface $node) use ($currentUrl) {

                return
                    $node->isActive($currentUrl) ||
                    $node->isExpanded($currentUrl);
            });
    }
public function isExpanded($currentUrl)
    {
        if (!$this->subnodes instanceof Collection) {
            return false;
        }

        return $this
            ->subnodes
            ->exists(function ($_, NodeInterface $node) use ($currentUrl) {

                return
                    $node->isActive($currentUrl) ||
                    $node->isExpanded($currentUrl);
            });
    }
public function isExpanded ( $ currentUrl ) { if ( ! $ this -> subnodes instanceof Collection ) { return false ; } return $ this -> subnodes -> exists ( function ( $ _ , NodeInterface $ node ) use ( $ currentUrl ) { return $ node -> isActive ( $ currentUrl ) || $ node -> isExpanded ( $ currentUrl ) ; } ) ; }
Is expanded.

A menu node is considered expanded when any of their children is active
or expanded

@param string $currentUrl Current Url

@return bool Menu Node is expanded
Is expanded .