Problem/Motivation
While working on #296693: Restrict access to empty top level administration pages I discover that \Drupal\Core\Menu\MenuLinkTree::load is sometimes sent NULL for the menu name, like in \Drupal\system\Controller\SystemController::overview, but it is not documented that this possible and what it means. \Drupal\Core\Menu\MenuLinkTreeInterface::load says it must be a string and the function definition does not have parameter type hint.
This also cascades into the methods it calls passing on the NULL when it is also documented that is acceptable value into
\Drupal\Core\Menu\MenuTreeStorage::loadTreeData
Proposed resolution
Update the @param doc to specify that NULL is possible value and in what circumstances.
If we could add a ?string type hint that would also be great
Comments