class LazyRouteProviderInstallTestHooks

Same name and namespace in other branches
  1. 11.x core/modules/system/tests/modules/lazy_route_provider_install_test/src/Hook/LazyRouteProviderInstallTestHooks.php \Drupal\lazy_route_provider_install_test\Hook\LazyRouteProviderInstallTestHooks

Hook implementations for lazy_route_provider_install_test.

Hierarchy

Expanded class hierarchy of LazyRouteProviderInstallTestHooks

File

core/modules/system/tests/modules/lazy_route_provider_install_test/src/Hook/LazyRouteProviderInstallTestHooks.php, line 12

Namespace

Drupal\lazy_route_provider_install_test\Hook
View source
class LazyRouteProviderInstallTestHooks {
  
  /**
   * Implements hook_menu_links_discovered_alter().
   */
  public function menuLinksDiscoveredAlter(&$links) : void {
    $message = \Drupal::state()->get('lazy_route_provider_install_test_menu_links_discovered_alter', 'success');
    try {
      // Ensure that calling this does not cause a recursive rebuild.
      \Drupal::service('router.route_provider')->getAllRoutes();
    } catch (\RuntimeException) {
      $message = 'failed';
    }
    \Drupal::state()->set('lazy_route_provider_install_test_menu_links_discovered_alter', $message);
  }

}

Members

Title Sort descending Modifiers Object type Summary
LazyRouteProviderInstallTestHooks::menuLinksDiscoveredAlter public function Implements hook_menu_links_discovered_alter().

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.