Issue #3523795: PageVariantInterface::setTitle also accepts \Stringable, update PHPDoc
2 unresolved threads
Merge request reports
Activity
204 204 protected function prepare(array $main_content, Request $request, RouteMatchInterface $route_match) { 205 205 // Determine the title: use the title provided by the main content if any, 206 206 // otherwise get it from the routing information. 207 $get_title = function (array $main_content) use ($request, $route_match) { 207 $get_title = function (array $main_content) use ($request, $route_match): array|string|\Stringable|null { 208 208 return $main_content['#title'] ?? $this->titleResolver->getTitle($request, $route_match->getRouteObject()); 255 253 } 256 254 $page_display 257 255 ->setMainContent($main_content) 258 ->setTitle($title) 259 256 ->addCacheableDependency($event); 257 258 $title = $get_title($main_content); 259 if ($title !== NULL) {
Please register or sign in to reply