From c604da742850968d227f740fa3421cfd4de67d64 Mon Sep 17 00:00:00 2001 From: Alexander Ebert Date: Wed, 20 Sep 2023 15:17:51 +0200 Subject: [PATCH] Move the icon property initialization into the constructor --- .../files/lib/data/user/menu/item/UserMenuItem.class.php | 3 +-- .../menu/item/event/UserMenuItemIconResolving.class.php | 8 ++++---- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/wcfsetup/install/files/lib/data/user/menu/item/UserMenuItem.class.php b/wcfsetup/install/files/lib/data/user/menu/item/UserMenuItem.class.php index 0ecb521f4f..5c28ec5839 100644 --- a/wcfsetup/install/files/lib/data/user/menu/item/UserMenuItem.class.php +++ b/wcfsetup/install/files/lib/data/user/menu/item/UserMenuItem.class.php @@ -161,8 +161,7 @@ class UserMenuItem extends ProcessibleDatabaseObject implements ITitledObject, I $icon = FontAwesomeIcon::fromValues('bars'); } - $event = new UserMenuItemIconResolving($this); - $event->icon = $icon; + $event = new UserMenuItemIconResolving($this, $icon); EventHandler::getInstance()->fire($event); return $event->icon; diff --git a/wcfsetup/install/files/lib/data/user/menu/item/event/UserMenuItemIconResolving.class.php b/wcfsetup/install/files/lib/data/user/menu/item/event/UserMenuItemIconResolving.class.php index 5a811460db..4351fb928b 100644 --- a/wcfsetup/install/files/lib/data/user/menu/item/event/UserMenuItemIconResolving.class.php +++ b/wcfsetup/install/files/lib/data/user/menu/item/event/UserMenuItemIconResolving.class.php @@ -16,9 +16,9 @@ use wcf\system\style\IFontAwesomeIcon; */ final class UserMenuItemIconResolving implements IEvent { - public IFontAwesomeIcon $icon; - - public function __construct(public readonly UserMenuItem $userMenuItem) - { + public function __construct( + public readonly UserMenuItem $userMenuItem, + public IFontAwesomeIcon $icon + ) { } } -- 2.20.1