app/Module/ModuleListTrait.php
public function listMenu(Tree $tree): ?Menu
    {
        if ($this->listIsEmpty($tree)) {
            return null;
        }
        
        return new Menu(
            $this->listTitle(),
            $this->listUrl($tree),
            $this->listMenuClass(),
            $this->listUrlAttributes()
        );
    }
public function listMenu(Tree $tree): ?Menu
    {
        if ($this->listIsEmpty($tree)) {
            return null;
        }
        
        return new Menu(
            $this->listTitle(),
            $this->listUrl($tree),
            $this->listMenuClass(),
            $this->listUrlAttributes()
        );
    }
public function listMenu ( Tree $ tree ) : ? Menu { if ( $ this -> listIsEmpty ( $ tree ) ) { return null ; } return new Menu ( $ this -> listTitle ( ) , $ this -> listUrl ( $ tree ) , $ this -> listMenuClass ( ) , $ this -> listUrlAttributes ( ) ) ; }
A main menu item for this list, or null if the list is empty.

@param Tree $tree

@return Menu|null
A main menu item for this list or null if the list is empty .