Skip to content

Commit

Permalink
Replace early construct call with property coalesce assignments
Browse files Browse the repository at this point in the history
  • Loading branch information
caendesilva committed Mar 24, 2024
1 parent 1ed674b commit 4ea66c6
Showing 1 changed file with 3 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -63,12 +63,9 @@ public static function create(Route|string $destination, ?string $label = null,
}

if ($destination instanceof Route) {
return new self(
$destination,
$label ?? $destination->getPage()->navigationMenuLabel(),
$priority ?? $destination->getPage()->navigationMenuPriority(),
$group ?? $destination->getPage()->navigationMenuGroup(),
);
$label ??= $destination->getPage()->navigationMenuLabel();
$priority ??= $destination->getPage()->navigationMenuPriority();
$group ??= $destination->getPage()->navigationMenuGroup();
}

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

0 comments on commit 4ea66c6

Please sign in to comment.