Apply suggestions from code review
authorMarcel Werk <burntime@woltlab.com>
Fri, 19 Jan 2024 14:46:46 +0000 (15:46 +0100)
committerMarcel Werk <burntime@woltlab.com>
Fri, 19 Jan 2024 14:46:46 +0000 (15:46 +0100)
wcfsetup/install/files/lib/system/page/handler/AbstractMenuPageHandler.class.php
wcfsetup/install/files/lib/system/page/handler/IMenuPageHandler.class.php

index c674dd38c264c77e50d170dfcf1bacf9524d3a15..c3dc9611d0463deefdfbc530224f16da8ea37886 100644 (file)
@@ -56,8 +56,8 @@ abstract class AbstractMenuPageHandler implements IMenuPageHandler
     /**
      * @inheritDoc
      */
-    public function getMenuItem(): MenuItem
+    public function getMenuItem(): ?MenuItem
     {
-        return $this->menuItem;
+        return $this->menuItem ?? null;
     }
 }
index 46d2da7b9208a80e12de00dbcde537d57328060b..7aeb30bb1f9a4cc7a85e9f3427c0ee1bb0024026 100644 (file)
@@ -50,5 +50,5 @@ interface IMenuPageHandler
     /**
      * @since 6.1
      */
-    public function getMenuItem(): MenuItem;
+    public function getMenuItem(): ?MenuItem;
 }