From 6ed117bc0ba73f24a7871921bc05a04e5b138ec9 Mon Sep 17 00:00:00 2001 From: Caen De Silva Date: Mon, 15 Apr 2024 16:57:51 +0200 Subject: [PATCH 01/39] Run workflow on all branches --- .github/workflows/static-analysis.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/static-analysis.yml b/.github/workflows/static-analysis.yml index f0b34dc94d9..ea95ebd45a8 100644 --- a/.github/workflows/static-analysis.yml +++ b/.github/workflows/static-analysis.yml @@ -2,7 +2,6 @@ name: 🔎 Static Analysis on: pull_request: - branches: [ "master" ] jobs: From c660d36fa0123c108a740d6661068877c461ce14 Mon Sep 17 00:00:00 2001 From: Caen De Silva Date: Mon, 15 Apr 2024 16:58:03 +0200 Subject: [PATCH 02/39] Add type annotation for wrapped array --- .../src/Framework/Features/Navigation/NavigationMenu.php | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/framework/src/Framework/Features/Navigation/NavigationMenu.php b/packages/framework/src/Framework/Features/Navigation/NavigationMenu.php index 7329b6bfbe9..2dc4c0e61c5 100644 --- a/packages/framework/src/Framework/Features/Navigation/NavigationMenu.php +++ b/packages/framework/src/Framework/Features/Navigation/NavigationMenu.php @@ -56,6 +56,7 @@ public function getItems(): Collection */ public function add(NavigationItem|NavigationGroup|array $items): static { + /** @var \Hyde\Framework\Features\Navigation\NavigationItem $item */ foreach (Arr::wrap($items) as $item) { $this->addItem($item); } From 9703afb7ac7e6afa47443f2691eead3204a8967b Mon Sep 17 00:00:00 2001 From: Caen De Silva Date: Mon, 15 Apr 2024 17:30:24 +0200 Subject: [PATCH 03/39] Type annotate container access --- .../Framework/Features/Navigation/DocumentationSidebar.php | 5 ++++- .../src/Framework/Features/Navigation/MainNavigationMenu.php | 5 ++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/packages/framework/src/Framework/Features/Navigation/DocumentationSidebar.php b/packages/framework/src/Framework/Features/Navigation/DocumentationSidebar.php index 6e8332b8ad2..e8b0aa78c2e 100644 --- a/packages/framework/src/Framework/Features/Navigation/DocumentationSidebar.php +++ b/packages/framework/src/Framework/Features/Navigation/DocumentationSidebar.php @@ -19,7 +19,10 @@ class DocumentationSidebar extends NavigationMenu */ public static function get(): static { - return app('navigation.sidebar'); + /** @var self::class $menu */ + $menu = app('navigation.sidebar'); + + return $menu; } public function __construct(Arrayable|array $items = []) diff --git a/packages/framework/src/Framework/Features/Navigation/MainNavigationMenu.php b/packages/framework/src/Framework/Features/Navigation/MainNavigationMenu.php index e6681c42ffd..f735186d29f 100644 --- a/packages/framework/src/Framework/Features/Navigation/MainNavigationMenu.php +++ b/packages/framework/src/Framework/Features/Navigation/MainNavigationMenu.php @@ -10,6 +10,9 @@ class MainNavigationMenu extends NavigationMenu { public static function get(): static { - return app('navigation.main'); + /** @var self::class $menu */ + $menu = app('navigation.main'); + + return $menu; } } From 2efd122f53beb115e1b8c3480401dcc4369e1d9d Mon Sep 17 00:00:00 2001 From: Caen De Silva Date: Mon, 15 Apr 2024 17:52:12 +0200 Subject: [PATCH 04/39] Create .phpstorm.meta.php --- .phpstorm.meta.php | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 .phpstorm.meta.php diff --git a/.phpstorm.meta.php b/.phpstorm.meta.php new file mode 100644 index 00000000000..f7f7bf84097 --- /dev/null +++ b/.phpstorm.meta.php @@ -0,0 +1,8 @@ + \Hyde\Framework\Features\Navigation\MainNavigationMenu::class, + 'navigation.sidebar' => \Hyde\Framework\Features\Navigation\DocumentationSidebar::class, + ])); +} From 617142a189dfdfb8a4ec09279f9ab8c6cdf2bede Mon Sep 17 00:00:00 2001 From: Caen De Silva Date: Mon, 15 Apr 2024 18:03:55 +0200 Subject: [PATCH 05/39] Create sdf.meta.php --- .phpstorm.meta.php => .phpstorm.meta.php/sdf.meta.php | 4 ++++ 1 file changed, 4 insertions(+) rename .phpstorm.meta.php => .phpstorm.meta.php/sdf.meta.php (73%) diff --git a/.phpstorm.meta.php b/.phpstorm.meta.php/sdf.meta.php similarity index 73% rename from .phpstorm.meta.php rename to .phpstorm.meta.php/sdf.meta.php index f7f7bf84097..8ac94568820 100644 --- a/.phpstorm.meta.php +++ b/.phpstorm.meta.php/sdf.meta.php @@ -1,8 +1,12 @@ '@', 'navigation.main' => \Hyde\Framework\Features\Navigation\MainNavigationMenu::class, 'navigation.sidebar' => \Hyde\Framework\Features\Navigation\DocumentationSidebar::class, ])); + + expectedArguments(\app(), 0, 'navigation.main', 'navigation.sidebar'); } From 98529993bf72ee975d4d15791a0656cce18d8dc9 Mon Sep 17 00:00:00 2001 From: Caen De Silva Date: Mon, 15 Apr 2024 18:03:58 +0200 Subject: [PATCH 06/39] Revert "Create sdf.meta.php" This reverts commit 617142a189dfdfb8a4ec09279f9ab8c6cdf2bede. --- .phpstorm.meta.php/sdf.meta.php => .phpstorm.meta.php | 4 ---- 1 file changed, 4 deletions(-) rename .phpstorm.meta.php/sdf.meta.php => .phpstorm.meta.php (73%) diff --git a/.phpstorm.meta.php/sdf.meta.php b/.phpstorm.meta.php similarity index 73% rename from .phpstorm.meta.php/sdf.meta.php rename to .phpstorm.meta.php index 8ac94568820..f7f7bf84097 100644 --- a/.phpstorm.meta.php/sdf.meta.php +++ b/.phpstorm.meta.php @@ -1,12 +1,8 @@ '@', 'navigation.main' => \Hyde\Framework\Features\Navigation\MainNavigationMenu::class, 'navigation.sidebar' => \Hyde\Framework\Features\Navigation\DocumentationSidebar::class, ])); - - expectedArguments(\app(), 0, 'navigation.main', 'navigation.sidebar'); } From 6a80301690feab53d4e4fb3501807871d0ee05b9 Mon Sep 17 00:00:00 2001 From: Caen De Silva Date: Mon, 15 Apr 2024 18:15:33 +0200 Subject: [PATCH 07/39] Revert "Type annotate container access" This reverts commit 9703afb7ac7e6afa47443f2691eead3204a8967b. --- .../Framework/Features/Navigation/DocumentationSidebar.php | 5 +---- .../src/Framework/Features/Navigation/MainNavigationMenu.php | 5 +---- 2 files changed, 2 insertions(+), 8 deletions(-) diff --git a/packages/framework/src/Framework/Features/Navigation/DocumentationSidebar.php b/packages/framework/src/Framework/Features/Navigation/DocumentationSidebar.php index e8b0aa78c2e..6e8332b8ad2 100644 --- a/packages/framework/src/Framework/Features/Navigation/DocumentationSidebar.php +++ b/packages/framework/src/Framework/Features/Navigation/DocumentationSidebar.php @@ -19,10 +19,7 @@ class DocumentationSidebar extends NavigationMenu */ public static function get(): static { - /** @var self::class $menu */ - $menu = app('navigation.sidebar'); - - return $menu; + return app('navigation.sidebar'); } public function __construct(Arrayable|array $items = []) diff --git a/packages/framework/src/Framework/Features/Navigation/MainNavigationMenu.php b/packages/framework/src/Framework/Features/Navigation/MainNavigationMenu.php index f735186d29f..e6681c42ffd 100644 --- a/packages/framework/src/Framework/Features/Navigation/MainNavigationMenu.php +++ b/packages/framework/src/Framework/Features/Navigation/MainNavigationMenu.php @@ -10,9 +10,6 @@ class MainNavigationMenu extends NavigationMenu { public static function get(): static { - /** @var self::class $menu */ - $menu = app('navigation.main'); - - return $menu; + return app('navigation.main'); } } From 4188a96fb983860757f0e3952eec6018595ac87f Mon Sep 17 00:00:00 2001 From: Caen De Silva Date: Mon, 15 Apr 2024 18:23:55 +0200 Subject: [PATCH 08/39] Add generics to the evaluate arrayable helper --- packages/framework/src/helpers.php | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/packages/framework/src/helpers.php b/packages/framework/src/helpers.php index eccc720e66f..26ffc238bb2 100644 --- a/packages/framework/src/helpers.php +++ b/packages/framework/src/helpers.php @@ -144,6 +144,13 @@ function trim_slashes(string $string): string } if (! function_exists('\Hyde\evaluate_arrayable')) { + /** + * Evaluate an arrayable object or an array to an array. + * + * @template T + * @param array|Arrayable $array + * @return array + */ function evaluate_arrayable(array|Arrayable $array): array { return $array instanceof Arrayable ? $array->toArray() : $array; From 7cc489b519d1034d57790abf61671580358f9156 Mon Sep 17 00:00:00 2001 From: Caen De Silva Date: Mon, 15 Apr 2024 18:24:51 +0200 Subject: [PATCH 09/39] Revert "Add generics to the evaluate arrayable helper" This reverts commit 4188a96fb983860757f0e3952eec6018595ac87f. --- packages/framework/src/helpers.php | 7 ------- 1 file changed, 7 deletions(-) diff --git a/packages/framework/src/helpers.php b/packages/framework/src/helpers.php index 26ffc238bb2..eccc720e66f 100644 --- a/packages/framework/src/helpers.php +++ b/packages/framework/src/helpers.php @@ -144,13 +144,6 @@ function trim_slashes(string $string): string } if (! function_exists('\Hyde\evaluate_arrayable')) { - /** - * Evaluate an arrayable object or an array to an array. - * - * @template T - * @param array|Arrayable $array - * @return array - */ function evaluate_arrayable(array|Arrayable $array): array { return $array instanceof Arrayable ? $array->toArray() : $array; From b05b5e2a2d92a5b2cd91b7eac6d17d59ccbd2628 Mon Sep 17 00:00:00 2001 From: Caen De Silva Date: Mon, 15 Apr 2024 18:32:39 +0200 Subject: [PATCH 10/39] Add type generics --- .../src/Framework/Features/Navigation/NavigationMenu.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/packages/framework/src/Framework/Features/Navigation/NavigationMenu.php b/packages/framework/src/Framework/Features/Navigation/NavigationMenu.php index 2dc4c0e61c5..cc74ca46f0c 100644 --- a/packages/framework/src/Framework/Features/Navigation/NavigationMenu.php +++ b/packages/framework/src/Framework/Features/Navigation/NavigationMenu.php @@ -23,7 +23,11 @@ class NavigationMenu public const DEFAULT = 500; public const LAST = 999; - /** @var \Illuminate\Support\Collection<\Hyde\Framework\Features\Navigation\NavigationItem|\Hyde\Framework\Features\Navigation\NavigationGroup> */ + /** + * @var \Illuminate\Support\Collection<\Hyde\Framework\Features\Navigation\NavigationItem|\Hyde\Framework\Features\Navigation\NavigationGroup> + * @template T of NavigationItem|NavigationGroup + * @template TValue of T + */ protected Collection $items; public function __construct(Arrayable|array $items = []) From c7a7d06b41a36757b8aa59827b8a870826fd0eaa Mon Sep 17 00:00:00 2001 From: Caen De Silva Date: Mon, 15 Apr 2024 18:34:08 +0200 Subject: [PATCH 11/39] Revert "Add type generics" This reverts commit b05b5e2a2d92a5b2cd91b7eac6d17d59ccbd2628. --- .../src/Framework/Features/Navigation/NavigationMenu.php | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/packages/framework/src/Framework/Features/Navigation/NavigationMenu.php b/packages/framework/src/Framework/Features/Navigation/NavigationMenu.php index cc74ca46f0c..2dc4c0e61c5 100644 --- a/packages/framework/src/Framework/Features/Navigation/NavigationMenu.php +++ b/packages/framework/src/Framework/Features/Navigation/NavigationMenu.php @@ -23,11 +23,7 @@ class NavigationMenu public const DEFAULT = 500; public const LAST = 999; - /** - * @var \Illuminate\Support\Collection<\Hyde\Framework\Features\Navigation\NavigationItem|\Hyde\Framework\Features\Navigation\NavigationGroup> - * @template T of NavigationItem|NavigationGroup - * @template TValue of T - */ + /** @var \Illuminate\Support\Collection<\Hyde\Framework\Features\Navigation\NavigationItem|\Hyde\Framework\Features\Navigation\NavigationGroup> */ protected Collection $items; public function __construct(Arrayable|array $items = []) From 439050dc4b88dc5f91c011ef817c960ffed45a7a Mon Sep 17 00:00:00 2001 From: Caen De Silva Date: Mon, 15 Apr 2024 18:35:33 +0200 Subject: [PATCH 12/39] Introduce type annotated variable --- .../Framework/Features/Navigation/DocumentationSidebar.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/packages/framework/src/Framework/Features/Navigation/DocumentationSidebar.php b/packages/framework/src/Framework/Features/Navigation/DocumentationSidebar.php index 6e8332b8ad2..fb13b0b91bc 100644 --- a/packages/framework/src/Framework/Features/Navigation/DocumentationSidebar.php +++ b/packages/framework/src/Framework/Features/Navigation/DocumentationSidebar.php @@ -76,9 +76,12 @@ public function getActiveGroup(): ?NavigationGroup return $this->items->sortBy(fn (NavigationGroup $item): int => $item->getPriority())->first(); } - return $this->items->first(function (NavigationGroup $group) use ($currentPage): bool { + /** @var ?NavigationGroup $first */ + $first = $this->items->first(function (NavigationGroup $group) use ($currentPage): bool { // A group is active when it contains the current page being rendered. return $currentPage->navigationMenuGroup() && $group->getGroupKey() === NavigationGroup::normalizeGroupKey($currentPage->navigationMenuGroup()); }); + + return $first; } } From e1af2cd3fc4dc9293697e468ef0092616eeebd1a Mon Sep 17 00:00:00 2001 From: Caen De Silva Date: Mon, 15 Apr 2024 18:38:46 +0200 Subject: [PATCH 13/39] Annotate arrayable generics --- .../src/Framework/Features/Navigation/NavigationMenu.php | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/framework/src/Framework/Features/Navigation/NavigationMenu.php b/packages/framework/src/Framework/Features/Navigation/NavigationMenu.php index 2dc4c0e61c5..780c07f2ad8 100644 --- a/packages/framework/src/Framework/Features/Navigation/NavigationMenu.php +++ b/packages/framework/src/Framework/Features/Navigation/NavigationMenu.php @@ -26,6 +26,7 @@ class NavigationMenu /** @var \Illuminate\Support\Collection<\Hyde\Framework\Features\Navigation\NavigationItem|\Hyde\Framework\Features\Navigation\NavigationGroup> */ protected Collection $items; + /** @param \Illuminate\Contracts\Support\Arrayable>|array<\Hyde\Framework\Features\Navigation\NavigationItem|\Hyde\Framework\Features\Navigation\NavigationGroup> $items */ public function __construct(Arrayable|array $items = []) { $this->items = new Collection(); From 662915544a8c820869803d1f87aea968b254cd22 Mon Sep 17 00:00:00 2001 From: Caen De Silva Date: Mon, 15 Apr 2024 18:41:23 +0200 Subject: [PATCH 14/39] Annotate the constant types --- .../src/Framework/Features/Navigation/NavigationMenu.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/packages/framework/src/Framework/Features/Navigation/NavigationMenu.php b/packages/framework/src/Framework/Features/Navigation/NavigationMenu.php index 780c07f2ad8..560222c320e 100644 --- a/packages/framework/src/Framework/Features/Navigation/NavigationMenu.php +++ b/packages/framework/src/Framework/Features/Navigation/NavigationMenu.php @@ -20,7 +20,10 @@ */ class NavigationMenu { + /** @var int The default priority for navigation items. */ public const DEFAULT = 500; + + /** @var int Place the item last in the menu. */ public const LAST = 999; /** @var \Illuminate\Support\Collection<\Hyde\Framework\Features\Navigation\NavigationItem|\Hyde\Framework\Features\Navigation\NavigationGroup> */ From e3f891aee2b1895fba7c4d75d569e47261c1c845 Mon Sep 17 00:00:00 2001 From: Caen De Silva Date: Mon, 15 Apr 2024 18:46:07 +0200 Subject: [PATCH 15/39] Annotate the evaluated array generics --- .../src/Framework/Features/Navigation/NavigationMenu.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/packages/framework/src/Framework/Features/Navigation/NavigationMenu.php b/packages/framework/src/Framework/Features/Navigation/NavigationMenu.php index 560222c320e..6d59056f277 100644 --- a/packages/framework/src/Framework/Features/Navigation/NavigationMenu.php +++ b/packages/framework/src/Framework/Features/Navigation/NavigationMenu.php @@ -34,7 +34,10 @@ public function __construct(Arrayable|array $items = []) { $this->items = new Collection(); - $this->add(evaluate_arrayable($items)); + /** @var array<\Hyde\Framework\Features\Navigation\NavigationItem|\Hyde\Framework\Features\Navigation\NavigationGroup> $items */ + $items = evaluate_arrayable($items); + + $this->add($items); } /** From 92d3693ee6d6387bbb1353c8fe69841485c7bc84 Mon Sep 17 00:00:00 2001 From: Caen De Silva Date: Mon, 15 Apr 2024 18:46:20 +0200 Subject: [PATCH 16/39] Revert "Annotate the constant types" This reverts commit 662915544a8c820869803d1f87aea968b254cd22. --- .../src/Framework/Features/Navigation/NavigationMenu.php | 3 --- 1 file changed, 3 deletions(-) diff --git a/packages/framework/src/Framework/Features/Navigation/NavigationMenu.php b/packages/framework/src/Framework/Features/Navigation/NavigationMenu.php index 6d59056f277..860abd9fc85 100644 --- a/packages/framework/src/Framework/Features/Navigation/NavigationMenu.php +++ b/packages/framework/src/Framework/Features/Navigation/NavigationMenu.php @@ -20,10 +20,7 @@ */ class NavigationMenu { - /** @var int The default priority for navigation items. */ public const DEFAULT = 500; - - /** @var int Place the item last in the menu. */ public const LAST = 999; /** @var \Illuminate\Support\Collection<\Hyde\Framework\Features\Navigation\NavigationItem|\Hyde\Framework\Features\Navigation\NavigationGroup> */ From a512e24219f728ba698bee3d2cdc4a2e7050fe9c Mon Sep 17 00:00:00 2001 From: Caen De Silva Date: Mon, 15 Apr 2024 18:50:07 +0200 Subject: [PATCH 17/39] Fix invalid template parameters --- .../src/Framework/Features/Navigation/NavigationMenu.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/framework/src/Framework/Features/Navigation/NavigationMenu.php b/packages/framework/src/Framework/Features/Navigation/NavigationMenu.php index 860abd9fc85..7acd44d47be 100644 --- a/packages/framework/src/Framework/Features/Navigation/NavigationMenu.php +++ b/packages/framework/src/Framework/Features/Navigation/NavigationMenu.php @@ -26,7 +26,7 @@ class NavigationMenu /** @var \Illuminate\Support\Collection<\Hyde\Framework\Features\Navigation\NavigationItem|\Hyde\Framework\Features\Navigation\NavigationGroup> */ protected Collection $items; - /** @param \Illuminate\Contracts\Support\Arrayable>|array<\Hyde\Framework\Features\Navigation\NavigationItem|\Hyde\Framework\Features\Navigation\NavigationGroup> $items */ + /** @param \Illuminate\Contracts\Support\Arrayable<\Hyde\Framework\Features\Navigation\NavigationItem|\Hyde\Framework\Features\Navigation\NavigationGroup>|array<\Hyde\Framework\Features\Navigation\NavigationItem|\Hyde\Framework\Features\Navigation\NavigationGroup> $items */ public function __construct(Arrayable|array $items = []) { $this->items = new Collection(); From 619c62e6523e979daa5d9af2bde7e35fd5a91af5 Mon Sep 17 00:00:00 2001 From: Caen De Silva Date: Mon, 15 Apr 2024 18:52:38 +0200 Subject: [PATCH 18/39] Annotate array key templates --- .../src/Framework/Features/Navigation/NavigationMenu.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/framework/src/Framework/Features/Navigation/NavigationMenu.php b/packages/framework/src/Framework/Features/Navigation/NavigationMenu.php index 7acd44d47be..facd0c91998 100644 --- a/packages/framework/src/Framework/Features/Navigation/NavigationMenu.php +++ b/packages/framework/src/Framework/Features/Navigation/NavigationMenu.php @@ -23,10 +23,10 @@ class NavigationMenu public const DEFAULT = 500; public const LAST = 999; - /** @var \Illuminate\Support\Collection<\Hyde\Framework\Features\Navigation\NavigationItem|\Hyde\Framework\Features\Navigation\NavigationGroup> */ + /** @var \Illuminate\Support\Collection */ protected Collection $items; - /** @param \Illuminate\Contracts\Support\Arrayable<\Hyde\Framework\Features\Navigation\NavigationItem|\Hyde\Framework\Features\Navigation\NavigationGroup>|array<\Hyde\Framework\Features\Navigation\NavigationItem|\Hyde\Framework\Features\Navigation\NavigationGroup> $items */ + /** @param \Illuminate\Contracts\Support\Arrayable|array<\Hyde\Framework\Features\Navigation\NavigationItem|\Hyde\Framework\Features\Navigation\NavigationGroup> $items */ public function __construct(Arrayable|array $items = []) { $this->items = new Collection(); @@ -42,7 +42,7 @@ public function __construct(Arrayable|array $items = []) * * Items are automatically sorted by their priority, falling back to the order they were added. * - * @return \Illuminate\Support\Collection<\Hyde\Framework\Features\Navigation\NavigationItem|\Hyde\Framework\Features\Navigation\NavigationGroup> + * @return \Illuminate\Support\Collection */ public function getItems(): Collection { From 0aa6814a5e02cd851fb820ec9982229b50d9ee00 Mon Sep 17 00:00:00 2001 From: Caen De Silva Date: Mon, 15 Apr 2024 18:58:11 +0200 Subject: [PATCH 19/39] Use type safe config accessor --- .../src/Framework/Features/Navigation/DocumentationSidebar.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/framework/src/Framework/Features/Navigation/DocumentationSidebar.php b/packages/framework/src/Framework/Features/Navigation/DocumentationSidebar.php index fb13b0b91bc..89bc9a033c2 100644 --- a/packages/framework/src/Framework/Features/Navigation/DocumentationSidebar.php +++ b/packages/framework/src/Framework/Features/Navigation/DocumentationSidebar.php @@ -29,7 +29,7 @@ public function __construct(Arrayable|array $items = []) public function getHeader(): string { - return Config::get('docs.sidebar.header', 'Documentation'); + return Config::getString('docs.sidebar.header', 'Documentation'); } public function getFooter(): ?string From 79436b52d370e747385da655b4bc5df9f4966b68 Mon Sep 17 00:00:00 2001 From: Caen De Silva Date: Mon, 15 Apr 2024 19:12:48 +0200 Subject: [PATCH 20/39] Extract generics template to clean up the class --- .../Features/Navigation/NavigationMenu.php | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/packages/framework/src/Framework/Features/Navigation/NavigationMenu.php b/packages/framework/src/Framework/Features/Navigation/NavigationMenu.php index facd0c91998..35c48ea651e 100644 --- a/packages/framework/src/Framework/Features/Navigation/NavigationMenu.php +++ b/packages/framework/src/Framework/Features/Navigation/NavigationMenu.php @@ -17,21 +17,23 @@ * * @example `$menu = app('navigation.main');` for the main navigation menu. * @example `$menu = app('navigation.sidebar');` for the documentation sidebar. + * + * @template T of NavigationItem|NavigationGroup */ class NavigationMenu { public const DEFAULT = 500; public const LAST = 999; - /** @var \Illuminate\Support\Collection */ + /** @var \Illuminate\Support\Collection */ protected Collection $items; - /** @param \Illuminate\Contracts\Support\Arrayable|array<\Hyde\Framework\Features\Navigation\NavigationItem|\Hyde\Framework\Features\Navigation\NavigationGroup> $items */ + /** @param \Illuminate\Contracts\Support\Arrayable|array $items */ public function __construct(Arrayable|array $items = []) { $this->items = new Collection(); - /** @var array<\Hyde\Framework\Features\Navigation\NavigationItem|\Hyde\Framework\Features\Navigation\NavigationGroup> $items */ + /** @var array $items */ $items = evaluate_arrayable($items); $this->add($items); @@ -42,7 +44,7 @@ public function __construct(Arrayable|array $items = []) * * Items are automatically sorted by their priority, falling back to the order they were added. * - * @return \Illuminate\Support\Collection + * @return \Illuminate\Support\Collection */ public function getItems(): Collection { @@ -56,11 +58,11 @@ public function getItems(): Collection /** * Add one or more navigation items to the navigation menu. * - * @param \Hyde\Framework\Features\Navigation\NavigationItem|\Hyde\Framework\Features\Navigation\NavigationGroup|array<\Hyde\Framework\Features\Navigation\NavigationItem|\Hyde\Framework\Features\Navigation\NavigationGroup> $items + * @param T|array $items */ public function add(NavigationItem|NavigationGroup|array $items): static { - /** @var \Hyde\Framework\Features\Navigation\NavigationItem $item */ + /** @var T $item */ foreach (Arr::wrap($items) as $item) { $this->addItem($item); } From 13b5e19222ef1276c1bf26c675a55c751f5d58b6 Mon Sep 17 00:00:00 2001 From: Caen De Silva Date: Mon, 15 Apr 2024 19:16:45 +0200 Subject: [PATCH 21/39] Annotate the supported config value types --- .../src/Framework/Features/Navigation/DocumentationSidebar.php | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/framework/src/Framework/Features/Navigation/DocumentationSidebar.php b/packages/framework/src/Framework/Features/Navigation/DocumentationSidebar.php index 89bc9a033c2..a5f01904b27 100644 --- a/packages/framework/src/Framework/Features/Navigation/DocumentationSidebar.php +++ b/packages/framework/src/Framework/Features/Navigation/DocumentationSidebar.php @@ -34,6 +34,7 @@ public function getHeader(): string public function getFooter(): ?string { + /** @var null|string|false $option */ $option = Config::get('docs.sidebar.footer', '[Back to home page](../)'); if (is_string($option)) { From 4607bbe2eea65dc57d0c23648a7c5f4c8e6460a7 Mon Sep 17 00:00:00 2001 From: Caen De Silva Date: Mon, 15 Apr 2024 19:31:14 +0200 Subject: [PATCH 22/39] Extract helper method for repeated code --- .../Features/Navigation/NavigationMenuGenerator.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/packages/framework/src/Framework/Features/Navigation/NavigationMenuGenerator.php b/packages/framework/src/Framework/Features/Navigation/NavigationMenuGenerator.php index d1476b87ac3..6a9f9f509e0 100644 --- a/packages/framework/src/Framework/Features/Navigation/NavigationMenuGenerator.php +++ b/packages/framework/src/Framework/Features/Navigation/NavigationMenuGenerator.php @@ -191,13 +191,18 @@ protected function searchForGroupLabelInConfig(string $groupKey): ?string { $key = $this->generatesSidebar ? 'docs.sidebar_group_labels' : 'hyde.navigation.labels'; - return Config::getArray($key, [])[$groupKey] ?? null; + return $this->getConfigArray($key, $groupKey); } protected function searchForGroupPriorityInConfig(string $groupKey): ?int { $key = $this->generatesSidebar ? 'docs.sidebar.order' : 'hyde.navigation.order'; + return $this->getConfigArray($key, $groupKey); + } + + protected function getConfigArray(string $key, string $groupKey): mixed + { return Config::getArray($key, [])[$groupKey] ?? null; } } From 32b91d37e6ee7cd6c4b058f7e5432761dded61be Mon Sep 17 00:00:00 2001 From: Caen De Silva Date: Mon, 15 Apr 2024 19:33:18 +0200 Subject: [PATCH 23/39] Shift array access to scope down helper method --- .../Features/Navigation/NavigationMenuGenerator.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/framework/src/Framework/Features/Navigation/NavigationMenuGenerator.php b/packages/framework/src/Framework/Features/Navigation/NavigationMenuGenerator.php index 6a9f9f509e0..b51609c4924 100644 --- a/packages/framework/src/Framework/Features/Navigation/NavigationMenuGenerator.php +++ b/packages/framework/src/Framework/Features/Navigation/NavigationMenuGenerator.php @@ -191,18 +191,18 @@ protected function searchForGroupLabelInConfig(string $groupKey): ?string { $key = $this->generatesSidebar ? 'docs.sidebar_group_labels' : 'hyde.navigation.labels'; - return $this->getConfigArray($key, $groupKey); + return $this->getConfigArray($key)[$groupKey] ?? null; } protected function searchForGroupPriorityInConfig(string $groupKey): ?int { $key = $this->generatesSidebar ? 'docs.sidebar.order' : 'hyde.navigation.order'; - return $this->getConfigArray($key, $groupKey); + return $this->getConfigArray($key)[$groupKey] ?? null; } - protected function getConfigArray(string $key, string $groupKey): mixed + protected function getConfigArray(string $key): array { - return Config::getArray($key, [])[$groupKey] ?? null; + return Config::getArray($key, []); } } From fc274745785548026c5f9384652644e83f41a0f1 Mon Sep 17 00:00:00 2001 From: Caen De Silva Date: Mon, 15 Apr 2024 19:39:32 +0200 Subject: [PATCH 24/39] Annotate the config array types --- .../Features/Navigation/NavigationMenuGenerator.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/packages/framework/src/Framework/Features/Navigation/NavigationMenuGenerator.php b/packages/framework/src/Framework/Features/Navigation/NavigationMenuGenerator.php index b51609c4924..b2486fa0502 100644 --- a/packages/framework/src/Framework/Features/Navigation/NavigationMenuGenerator.php +++ b/packages/framework/src/Framework/Features/Navigation/NavigationMenuGenerator.php @@ -203,6 +203,9 @@ protected function searchForGroupPriorityInConfig(string $groupKey): ?int protected function getConfigArray(string $key): array { - return Config::getArray($key, []); + /** @var array|array $array */ + $array = Config::getArray($key, []); + + return $array; } } From db435d7c4d73e09c031add55b45121e89b14b13f Mon Sep 17 00:00:00 2001 From: Caen De Silva Date: Mon, 15 Apr 2024 19:43:01 +0200 Subject: [PATCH 25/39] Inline added helper method --- .../Features/Navigation/NavigationMenuGenerator.php | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/packages/framework/src/Framework/Features/Navigation/NavigationMenuGenerator.php b/packages/framework/src/Framework/Features/Navigation/NavigationMenuGenerator.php index b2486fa0502..be480fbfd17 100644 --- a/packages/framework/src/Framework/Features/Navigation/NavigationMenuGenerator.php +++ b/packages/framework/src/Framework/Features/Navigation/NavigationMenuGenerator.php @@ -191,21 +191,19 @@ protected function searchForGroupLabelInConfig(string $groupKey): ?string { $key = $this->generatesSidebar ? 'docs.sidebar_group_labels' : 'hyde.navigation.labels'; - return $this->getConfigArray($key)[$groupKey] ?? null; + /** @var array|array $array */ + $array = Config::getArray($key, []); + + return ($array)[$groupKey] ?? null; } protected function searchForGroupPriorityInConfig(string $groupKey): ?int { $key = $this->generatesSidebar ? 'docs.sidebar.order' : 'hyde.navigation.order'; - return $this->getConfigArray($key)[$groupKey] ?? null; - } - - protected function getConfigArray(string $key): array - { /** @var array|array $array */ $array = Config::getArray($key, []); - return $array; + return ($array)[$groupKey] ?? null; } } From 803d1d6a62fc7fb3f627c0a1dea8c7319e227245 Mon Sep 17 00:00:00 2001 From: Caen De Silva Date: Mon, 15 Apr 2024 19:43:21 +0200 Subject: [PATCH 26/39] Revert "Inline added helper method" This reverts commit db435d7c4d73e09c031add55b45121e89b14b13f. --- .../Features/Navigation/NavigationMenuGenerator.php | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/packages/framework/src/Framework/Features/Navigation/NavigationMenuGenerator.php b/packages/framework/src/Framework/Features/Navigation/NavigationMenuGenerator.php index be480fbfd17..b2486fa0502 100644 --- a/packages/framework/src/Framework/Features/Navigation/NavigationMenuGenerator.php +++ b/packages/framework/src/Framework/Features/Navigation/NavigationMenuGenerator.php @@ -191,19 +191,21 @@ protected function searchForGroupLabelInConfig(string $groupKey): ?string { $key = $this->generatesSidebar ? 'docs.sidebar_group_labels' : 'hyde.navigation.labels'; - /** @var array|array $array */ - $array = Config::getArray($key, []); - - return ($array)[$groupKey] ?? null; + return $this->getConfigArray($key)[$groupKey] ?? null; } protected function searchForGroupPriorityInConfig(string $groupKey): ?int { $key = $this->generatesSidebar ? 'docs.sidebar.order' : 'hyde.navigation.order'; + return $this->getConfigArray($key)[$groupKey] ?? null; + } + + protected function getConfigArray(string $key): array + { /** @var array|array $array */ $array = Config::getArray($key, []); - return ($array)[$groupKey] ?? null; + return $array; } } From 894536e35b2358f62757740b194c4eb55c969ea4 Mon Sep 17 00:00:00 2001 From: Caen De Silva Date: Mon, 15 Apr 2024 19:43:52 +0200 Subject: [PATCH 27/39] Simplify array generics --- .../Framework/Features/Navigation/NavigationMenuGenerator.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/framework/src/Framework/Features/Navigation/NavigationMenuGenerator.php b/packages/framework/src/Framework/Features/Navigation/NavigationMenuGenerator.php index b2486fa0502..fab5ffa57c3 100644 --- a/packages/framework/src/Framework/Features/Navigation/NavigationMenuGenerator.php +++ b/packages/framework/src/Framework/Features/Navigation/NavigationMenuGenerator.php @@ -203,7 +203,7 @@ protected function searchForGroupPriorityInConfig(string $groupKey): ?int protected function getConfigArray(string $key): array { - /** @var array|array $array */ + /** @var array $array */ $array = Config::getArray($key, []); return $array; From 7ebca61349428e044764a6d64d620e7050ebada4 Mon Sep 17 00:00:00 2001 From: Caen De Silva Date: Mon, 15 Apr 2024 19:44:53 +0200 Subject: [PATCH 28/39] Annotate array return generics --- .../Framework/Features/Navigation/NavigationMenuGenerator.php | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/framework/src/Framework/Features/Navigation/NavigationMenuGenerator.php b/packages/framework/src/Framework/Features/Navigation/NavigationMenuGenerator.php index fab5ffa57c3..257afc54bbc 100644 --- a/packages/framework/src/Framework/Features/Navigation/NavigationMenuGenerator.php +++ b/packages/framework/src/Framework/Features/Navigation/NavigationMenuGenerator.php @@ -201,6 +201,7 @@ protected function searchForGroupPriorityInConfig(string $groupKey): ?int return $this->getConfigArray($key)[$groupKey] ?? null; } + /** @return array */ protected function getConfigArray(string $key): array { /** @var array $array */ From f26e4d6a47126569dfac804521beb3b0c24b61ba Mon Sep 17 00:00:00 2001 From: Caen De Silva Date: Mon, 15 Apr 2024 19:57:14 +0200 Subject: [PATCH 29/39] Fix missing union type in type annotation --- .../Framework/Features/Navigation/NavigationMenuGenerator.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/framework/src/Framework/Features/Navigation/NavigationMenuGenerator.php b/packages/framework/src/Framework/Features/Navigation/NavigationMenuGenerator.php index 257afc54bbc..42760bb8ba1 100644 --- a/packages/framework/src/Framework/Features/Navigation/NavigationMenuGenerator.php +++ b/packages/framework/src/Framework/Features/Navigation/NavigationMenuGenerator.php @@ -23,7 +23,7 @@ */ class NavigationMenuGenerator { - /** @var \Illuminate\Support\Collection */ + /** @var \Illuminate\Support\Collection */ protected Collection $items; /** @var \Hyde\Foundation\Kernel\RouteCollection */ From 12e8ab3e9c0d3f757c82af42a83127484e57a4d8 Mon Sep 17 00:00:00 2001 From: Caen De Silva Date: Mon, 15 Apr 2024 19:58:21 +0200 Subject: [PATCH 30/39] Inline local variables --- .../Features/Navigation/NavigationMenuGenerator.php | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/packages/framework/src/Framework/Features/Navigation/NavigationMenuGenerator.php b/packages/framework/src/Framework/Features/Navigation/NavigationMenuGenerator.php index 42760bb8ba1..d2bd01921f8 100644 --- a/packages/framework/src/Framework/Features/Navigation/NavigationMenuGenerator.php +++ b/packages/framework/src/Framework/Features/Navigation/NavigationMenuGenerator.php @@ -189,16 +189,12 @@ protected function normalizeGroupLabel(string $label): string protected function searchForGroupLabelInConfig(string $groupKey): ?string { - $key = $this->generatesSidebar ? 'docs.sidebar_group_labels' : 'hyde.navigation.labels'; - - return $this->getConfigArray($key)[$groupKey] ?? null; + return $this->getConfigArray($this->generatesSidebar ? 'docs.sidebar_group_labels' : 'hyde.navigation.labels')[$groupKey] ?? null; } protected function searchForGroupPriorityInConfig(string $groupKey): ?int { - $key = $this->generatesSidebar ? 'docs.sidebar.order' : 'hyde.navigation.order'; - - return $this->getConfigArray($key)[$groupKey] ?? null; + return $this->getConfigArray($this->generatesSidebar ? 'docs.sidebar.order' : 'hyde.navigation.order')[$groupKey] ?? null; } /** @return array */ From bbb7238aba2a7276af2e30fb1a04439adabcab21 Mon Sep 17 00:00:00 2001 From: Caen De Silva Date: Mon, 15 Apr 2024 20:10:12 +0200 Subject: [PATCH 31/39] Add integer cast for min function call --- .../src/Framework/Features/Navigation/NavigationGroup.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/framework/src/Framework/Features/Navigation/NavigationGroup.php b/packages/framework/src/Framework/Features/Navigation/NavigationGroup.php index 9c472b9366a..229960da009 100644 --- a/packages/framework/src/Framework/Features/Navigation/NavigationGroup.php +++ b/packages/framework/src/Framework/Features/Navigation/NavigationGroup.php @@ -44,7 +44,7 @@ public function getPriority(): int { if ($this->containsOnlyDocumentationPages()) { // For sidebar groups, we use the priority of the lowest priority child, unless the dropdown instance itself has a lower priority. - return min($this->priority, $this->getItems()->min(fn (NavigationItem $item): int => $item->getPriority())); + return (int) min($this->priority, $this->getItems()->min(fn (NavigationItem $item): int => $item->getPriority())); } return $this->priority; From 42b188fe7ee91e9640140a970b086317b2ba3af6 Mon Sep 17 00:00:00 2001 From: Caen De Silva Date: Mon, 15 Apr 2024 20:16:00 +0200 Subject: [PATCH 32/39] Override kernel binding --- .phpstorm.meta.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.phpstorm.meta.php b/.phpstorm.meta.php index f7f7bf84097..32e63379657 100644 --- a/.phpstorm.meta.php +++ b/.phpstorm.meta.php @@ -5,4 +5,7 @@ 'navigation.main' => \Hyde\Framework\Features\Navigation\MainNavigationMenu::class, 'navigation.sidebar' => \Hyde\Framework\Features\Navigation\DocumentationSidebar::class, ])); + override((new \Illuminate\Contracts\Container\Container())->make(0), map([ + \Hyde\Foundation\HydeKernel::class => \Hyde\Foundation\HydeKernel::class, + ])); } From e12b7dabd71af9626e165cfe4c7d1980f5aa4e1e Mon Sep 17 00:00:00 2001 From: Caen De Silva Date: Mon, 15 Apr 2024 20:28:51 +0200 Subject: [PATCH 33/39] Revert "Override kernel binding" This reverts commit 42b188fe7ee91e9640140a970b086317b2ba3af6. --- .phpstorm.meta.php | 3 --- 1 file changed, 3 deletions(-) diff --git a/.phpstorm.meta.php b/.phpstorm.meta.php index 32e63379657..f7f7bf84097 100644 --- a/.phpstorm.meta.php +++ b/.phpstorm.meta.php @@ -5,7 +5,4 @@ 'navigation.main' => \Hyde\Framework\Features\Navigation\MainNavigationMenu::class, 'navigation.sidebar' => \Hyde\Framework\Features\Navigation\DocumentationSidebar::class, ])); - override((new \Illuminate\Contracts\Container\Container())->make(0), map([ - \Hyde\Foundation\HydeKernel::class => \Hyde\Foundation\HydeKernel::class, - ])); } From 9e68809183f6ed064413c56226cbe6ef5f29792b Mon Sep 17 00:00:00 2001 From: Caen De Silva Date: Mon, 15 Apr 2024 20:31:19 +0200 Subject: [PATCH 34/39] Add code spacing --- .../tests/Feature/Services/DocumentationSidebarTest.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/packages/framework/tests/Feature/Services/DocumentationSidebarTest.php b/packages/framework/tests/Feature/Services/DocumentationSidebarTest.php index 23954a7c14e..6ce5db7a0b2 100644 --- a/packages/framework/tests/Feature/Services/DocumentationSidebarTest.php +++ b/packages/framework/tests/Feature/Services/DocumentationSidebarTest.php @@ -140,8 +140,10 @@ public function testSidebarPrioritiesCanBeSetInBothFrontMatterAndConfig() 'third', 'second', ]); + Filesystem::touch('_docs/first.md'); Filesystem::touch('_docs/second.md'); + file_put_contents(Hyde::path('_docs/third.md'), (new ConvertsArrayToFrontMatter)->execute(['navigation.priority' => 250 + 300]) ); From b04cf8be4147232d8c34ba03de3abcf6dfbe61a8 Mon Sep 17 00:00:00 2001 From: Caen De Silva Date: Mon, 15 Apr 2024 20:33:09 +0200 Subject: [PATCH 35/39] Revert "Run workflow on all branches" This reverts commit 6ed117bc0ba73f24a7871921bc05a04e5b138ec9. --- .github/workflows/static-analysis.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/static-analysis.yml b/.github/workflows/static-analysis.yml index b2acd0dd0c5..dba99d85384 100644 --- a/.github/workflows/static-analysis.yml +++ b/.github/workflows/static-analysis.yml @@ -2,6 +2,7 @@ name: 🔎 Static Analysis on: pull_request: + branches: [ "master" ] jobs: From 78a9434cdcb40fba25b051bf45b6e0641ab1d155 Mon Sep 17 00:00:00 2001 From: Caen De Silva Date: Mon, 15 Apr 2024 20:50:14 +0200 Subject: [PATCH 36/39] Revert "Update PhpStorm files" This reverts commit 2c70b02fe4576b288c832b62c7445bf0a5d42032. --- .idea/develop.iml | 1 + .idea/php.xml | 1 + .idea/phpspec.xml | 3 --- 3 files changed, 2 insertions(+), 3 deletions(-) diff --git a/.idea/develop.iml b/.idea/develop.iml index 8e317382cd6..57b84ebaf07 100644 --- a/.idea/develop.iml +++ b/.idea/develop.iml @@ -34,6 +34,7 @@ + diff --git a/.idea/php.xml b/.idea/php.xml index cde778e065a..d4d63270f91 100644 --- a/.idea/php.xml +++ b/.idea/php.xml @@ -147,6 +147,7 @@ + diff --git a/.idea/phpspec.xml b/.idea/phpspec.xml index 41f23c4c83d..c7cfbc2c5e6 100644 --- a/.idea/phpspec.xml +++ b/.idea/phpspec.xml @@ -11,9 +11,6 @@ - - \ No newline at end of file From fa6c20ad438489f38c82dcac7d33d4456999cdc7 Mon Sep 17 00:00:00 2001 From: Caen De Silva Date: Mon, 15 Apr 2024 20:54:19 +0200 Subject: [PATCH 37/39] Clean up test --- packages/framework/tests/Feature/NavigationMenuTest.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/packages/framework/tests/Feature/NavigationMenuTest.php b/packages/framework/tests/Feature/NavigationMenuTest.php index a98931a6e41..7f6cb8b3ac7 100644 --- a/packages/framework/tests/Feature/NavigationMenuTest.php +++ b/packages/framework/tests/Feature/NavigationMenuTest.php @@ -199,6 +199,7 @@ public function testPagesInSubdirectoriesAreNotAddedToTheNavigationMenu() $this->file('_pages/foo/bar.md'); $menu = $this->createNavigationMenu(); + $expected = collect([NavigationItem::create(Routes::get('index'))]); $this->assertCount(count($expected), $menu->getItems()); @@ -212,6 +213,7 @@ public function testPagesInSubdirectoriesCanBeAddedToTheNavigationMenuWithConfig $this->file('_pages/foo/bar.md'); $menu = $this->createNavigationMenu(); + $expected = collect([ NavigationItem::create(Routes::get('index')), NavigationItem::create(Routes::get('foo/bar')), @@ -228,6 +230,7 @@ public function testPagesInSubdirectoriesAreNotAddedToTheNavigationMenuWithConfi $this->file('_pages/foo/bar.md'); $menu = $this->createNavigationMenu(); + $expected = collect([ NavigationItem::create(Routes::get('index')), NavigationGroup::create('Foo', [ @@ -245,6 +248,7 @@ public function testPagesInDropdownsDoNotGetAddedToTheMainNavigation() Routes::push((new MarkdownPage('foo'))->getRoute()); Routes::push((new MarkdownPage('bar/baz'))->getRoute()); + $menu = $this->createNavigationMenu(); $this->assertCount(3, $menu->getItems()); From 76b69c0d8c72ac8843ea9a0ad819027bd5d0f478 Mon Sep 17 00:00:00 2001 From: Caen De Silva Date: Mon, 15 Apr 2024 20:54:47 +0200 Subject: [PATCH 38/39] Reapply "Update PhpStorm files" This reverts commit 78a9434cdcb40fba25b051bf45b6e0641ab1d155. --- .idea/develop.iml | 1 - .idea/php.xml | 1 - .idea/phpspec.xml | 3 +++ 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.idea/develop.iml b/.idea/develop.iml index 57b84ebaf07..8e317382cd6 100644 --- a/.idea/develop.iml +++ b/.idea/develop.iml @@ -34,7 +34,6 @@ - diff --git a/.idea/php.xml b/.idea/php.xml index d4d63270f91..cde778e065a 100644 --- a/.idea/php.xml +++ b/.idea/php.xml @@ -147,7 +147,6 @@ - diff --git a/.idea/phpspec.xml b/.idea/phpspec.xml index c7cfbc2c5e6..41f23c4c83d 100644 --- a/.idea/phpspec.xml +++ b/.idea/phpspec.xml @@ -11,6 +11,9 @@ + + \ No newline at end of file From 35ddecefa385cb252c2810703c7f99243fa43598 Mon Sep 17 00:00:00 2001 From: Caen De Silva Date: Mon, 15 Apr 2024 20:55:27 +0200 Subject: [PATCH 39/39] Remove unused testing helper method --- .../tests/Feature/AutomaticNavigationConfigurationsTest.php | 5 ----- 1 file changed, 5 deletions(-) diff --git a/packages/framework/tests/Feature/AutomaticNavigationConfigurationsTest.php b/packages/framework/tests/Feature/AutomaticNavigationConfigurationsTest.php index 5ae702cfad8..8d3ee0e380d 100644 --- a/packages/framework/tests/Feature/AutomaticNavigationConfigurationsTest.php +++ b/packages/framework/tests/Feature/AutomaticNavigationConfigurationsTest.php @@ -1327,11 +1327,6 @@ public function getState(int $index): ?TestNavigationItem return $this->state()[$index] ?? null; } - public function ddState(): void - { - dd($this->state()); - } - /** * @param array $expected The expected state format * @param bool $strict If false, missing array keys are ignored