From 9c7efa786aa1f8f6bc600076e4eb308ed9fd1231 Mon Sep 17 00:00:00 2001 From: Caen De Silva Date: Sun, 29 Oct 2023 13:08:28 +0100 Subject: [PATCH] Introduce local variable so we can use type annotation --- .../framework/src/Framework/Features/Navigation/NavItem.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/packages/framework/src/Framework/Features/Navigation/NavItem.php b/packages/framework/src/Framework/Features/Navigation/NavItem.php index db775d43e3a..7a57b554282 100644 --- a/packages/framework/src/Framework/Features/Navigation/NavItem.php +++ b/packages/framework/src/Framework/Features/Navigation/NavItem.php @@ -125,7 +125,10 @@ public function isCurrent(): bool protected static function getRouteGroup(Route $route): ?string { - return static::normalizeGroupKey($route->getPage()->data('navigation.group')); + /** @var string|null $group */ + $group = $route->getPage()->data('navigation.group'); + + return static::normalizeGroupKey($group); } protected static function normalizeGroupKey(?string $group): ?string