Skip to content

Commit c307b2a

Browse files
committed
minor #1341 use nullsafe operator in BlogController (MrYamous)
This PR was merged into the main branch. Discussion ---------- use nullsafe operator in BlogController Hi, Considering symfony/demo require php 8.0.2 I guess it'safe to use nullsafe instead ternary to get tag's name if `Tag` exist Commits ------- 491b896 use nullsafe operator
2 parents 9b4e412 + 491b896 commit c307b2a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Controller/BlogController.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ public function index(Request $request, int $page, string $_format, PostReposito
5959
// See https://symfony.com/doc/current/templates.html#template-naming
6060
return $this->render('blog/index.'.$_format.'.twig', [
6161
'paginator' => $latestPosts,
62-
'tagName' => $tag ? $tag->getName() : null,
62+
'tagName' => $tag?->getName(),
6363
]);
6464
}
6565

0 commit comments

Comments
 (0)