From c9d6bf7ff6dae3719eed4c2bb86a0664c1c9a44a Mon Sep 17 00:00:00 2001 From: Caen De Silva Date: Sun, 29 Oct 2023 13:13:02 +0100 Subject: [PATCH] Annotate config array shape --- .../src/Framework/Factories/NavigationDataFactory.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/packages/framework/src/Framework/Factories/NavigationDataFactory.php b/packages/framework/src/Framework/Factories/NavigationDataFactory.php index 3068855c630..a74dfbbeed3 100644 --- a/packages/framework/src/Framework/Factories/NavigationDataFactory.php +++ b/packages/framework/src/Framework/Factories/NavigationDataFactory.php @@ -139,10 +139,13 @@ private function searchForPriorityInFrontMatter(): ?int private function searchForLabelInConfig(): ?string { - return Config::getArray('hyde.navigation.labels', [ + /** @var array $config */ + $config = Config::getArray('hyde.navigation.labels', [ 'index' => 'Home', DocumentationPage::homeRouteName() => 'Docs', - ])[$this->routeKey] ?? null; + ]); + + return $config[$this->routeKey] ?? null; } private function searchForPriorityInConfigs(): ?int