NullRouteMatch example

$raw_variables = [];
      if ($raw = $request->attributes->get('_raw_variables')) {
        $raw_variables = $raw->all();
      }
      return new static(
        $request->attributes->get(RouteObjectInterface::ROUTE_NAME),
        $request->attributes->get(RouteObjectInterface::ROUTE_OBJECT),
        $request->attributes->all(),
        $raw_variables);
    }
    else {
      return new NullRouteMatch();
    }
  }

  /** * {@inheritdoc} */
  public function getRouteName() {
    return $this->routeName;
  }

  /** * {@inheritdoc} */

  protected static $modules = [
    'layout_builder',
    'layout_discovery',
  ];

  /** * Check that there are no errors when alter called with null route match. */
  public function testBreadcrumbAlterNullRouteMatch() {
    $breadcrumb = new Breadcrumb();
    $route_match = new NullRouteMatch();
    layout_builder_system_breadcrumb_alter($breadcrumb$route_match[]);
  }

}
Home | Imprint | This part of the site doesn't use cookies.