diff --git a/Classes/MenuService/ServiceInterface.php b/Classes/MenuService/ServiceInterface.php index f72e77a..bb3c892 100644 --- a/Classes/MenuService/ServiceInterface.php +++ b/Classes/MenuService/ServiceInterface.php @@ -22,5 +22,5 @@ interface ServiceInterface * * @return array|\Iterator */ - public function getItems(string $forPath = null): array; + public function getItems(string $forPath = null): \Iterator; } diff --git a/Classes/MenuService/SettingsService.php b/Classes/MenuService/SettingsService.php index 5e3c814..99ca0b4 100644 --- a/Classes/MenuService/SettingsService.php +++ b/Classes/MenuService/SettingsService.php @@ -32,11 +32,7 @@ class SettingsService implements ServiceInterface */ protected array $items = array(); - /** - * @param string|null $forPath - * @return array - */ - public function getItems(string $forPath = null): array + public function getItems(string $forPath = null): \Iterator { if ($forPath) { $items = &$this->menuConfiguration[$forPath]; @@ -51,6 +47,6 @@ class SettingsService implements ServiceInterface } ); } - return $items; + return new \ArrayIterator($items); } }