Skip to content

Commit

Permalink
Return new static instead of self
Browse files Browse the repository at this point in the history
Now longer needed as we decoupled the navigation group class
  • Loading branch information
caendesilva committed Mar 24, 2024
1 parent 4ea66c6 commit 3e4901b
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -56,7 +56,7 @@ public function __construct(Route|string $destination, string $label, int $prior
* @param string|null $label Leave blank to use the label of the route's corresponding page, if there is one tied to the route.
* @param string|null $group Leave blank to use the group of the route's corresponding page, if there is one tied to the route.
*/
public static function create(Route|string $destination, ?string $label = null, ?int $priority = null, ?string $group = null): self
public static function create(Route|string $destination, ?string $label = null, ?int $priority = null, ?string $group = null): static
{
if (is_string($destination) && Routes::has($destination)) {
$destination = Routes::get($destination);
@@ -68,7 +68,7 @@ public static function create(Route|string $destination, ?string $label = null,
$group ??= $destination->getPage()->navigationMenuGroup();
}

return new self($destination, $label ?? '', $priority ?? NavigationMenu::DEFAULT, $group);
return new static($destination, $label ?? '', $priority ?? NavigationMenu::DEFAULT, $group);
}

/**

0 comments on commit 3e4901b

Please sign in to comment.