From 208b726c3482a8f12c7e9840b28da2670c1b51b7 Mon Sep 17 00:00:00 2001 From: Hannes Bochmann Date: Fri, 1 Dec 2023 10:37:07 +0100 Subject: [PATCH] Fix return type of ViewHelpers #734 --- Classes/ViewHelpers/IndexTraversingViewHelper.php | 3 ++- Classes/ViewHelpers/IndicesByObjectViewHelper.php | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/Classes/ViewHelpers/IndexTraversingViewHelper.php b/Classes/ViewHelpers/IndexTraversingViewHelper.php index 02de932e..00c2c99f 100644 --- a/Classes/ViewHelpers/IndexTraversingViewHelper.php +++ b/Classes/ViewHelpers/IndexTraversingViewHelper.php @@ -7,6 +7,7 @@ use HDNET\Calendarize\Domain\Model\Index; use HDNET\Calendarize\Domain\Repository\IndexRepository; use TYPO3\CMS\Extbase\Persistence\QueryInterface; +use TYPO3\CMS\Extbase\Persistence\QueryResultInterface; /** * Index traversing. @@ -47,7 +48,7 @@ public function initializeArguments(): void /** * Render method. */ - public function render(): array + public function render(): array|QueryResultInterface { return $this->indexRepository->findByTraversing( $this->arguments['index'], diff --git a/Classes/ViewHelpers/IndicesByObjectViewHelper.php b/Classes/ViewHelpers/IndicesByObjectViewHelper.php index a878fa04..34e82345 100644 --- a/Classes/ViewHelpers/IndicesByObjectViewHelper.php +++ b/Classes/ViewHelpers/IndicesByObjectViewHelper.php @@ -9,6 +9,7 @@ use HDNET\Calendarize\Register; use TYPO3\CMS\Extbase\DomainObject\AbstractEntity; use TYPO3\CMS\Extbase\Persistence\QueryInterface; +use TYPO3\CMS\Extbase\Persistence\QueryResultInterface; /** * Indices by object. @@ -51,7 +52,7 @@ public function initializeArguments(): void /** * Render method. */ - public function render(): array + public function render(): array|QueryResultInterface { /** @var AbstractEntity $object */ $object = $this->arguments['object'];