class 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) {
        $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);
    }

}

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