Skip to content

Commit

Permalink
Move some variables around to make more sense
Browse files Browse the repository at this point in the history
  • Loading branch information
loevgaard committed Sep 9, 2024
1 parent ee14ef8 commit 89e13f0
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
3 changes: 1 addition & 2 deletions src/EventSubscriber/AddLinkToPeakSubscriber.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ public function addLink(OrderShowMenuBuilderEvent $event): void

$menu = $event->getMenu();
$sort = array_keys($menu->getChildren());
array_unshift($sort, self::MENU_ITEM_KEY);

$menu
->addChild(self::MENU_ITEM_KEY, [
Expand All @@ -54,8 +55,6 @@ public function addLink(OrderShowMenuBuilderEvent $event): void
->setLabelAttribute('color', 'blue')
;

array_unshift($sort, self::MENU_ITEM_KEY);

try {
$event->getMenu()->reorderChildren($sort);
} catch (\InvalidArgumentException) {
Expand Down
3 changes: 1 addition & 2 deletions src/EventSubscriber/AddResetLinkSubscriber.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ public function addLink(OrderShowMenuBuilderEvent $event): void

$menu = $event->getMenu();
$sort = array_keys($menu->getChildren());
array_unshift($sort, self::MENU_ITEM_KEY);

$menu
->addChild(self::MENU_ITEM_KEY, [
Expand All @@ -53,8 +54,6 @@ public function addLink(OrderShowMenuBuilderEvent $event): void
->setLabelAttribute('icon', 'redo')
;

array_unshift($sort, self::MENU_ITEM_KEY);

try {
$event->getMenu()->reorderChildren($sort);
} catch (\InvalidArgumentException) {
Expand Down

0 comments on commit 89e13f0

Please sign in to comment.