diff --git a/composer.json b/composer.json index 36490c12..297c9082 100644 --- a/composer.json +++ b/composer.json @@ -30,6 +30,7 @@ "ext-xmlwriter": "*", "hautelook/templated-uri-bundle": "^3.4", "ibexa/core": "dev-ibx-8534-core-v5-p2 as 5.0.x-dev", + "ibexa/polyfill-php82": "^1.0", "lexik/jwt-authentication-bundle": "^2.8", "symfony/config": "^5.3", "symfony/dependency-injection": "^5.3", diff --git a/src/lib/Server/Controller/Content.php b/src/lib/Server/Controller/Content.php index 1e9e7ac8..8f94555a 100644 --- a/src/lib/Server/Controller/Content.php +++ b/src/lib/Server/Controller/Content.php @@ -15,6 +15,7 @@ use Ibexa\Contracts\Core\Repository\Values\Content\Relation; use Ibexa\Contracts\Core\Repository\Values\Content\VersionInfo; use Ibexa\Contracts\Rest\Exceptions; +use function Ibexa\PolyfillPhp82\iterator_to_array; use Ibexa\Rest\Message; use Ibexa\Rest\Server\Controller as RestController; use Ibexa\Rest\Server\Exceptions\BadRequestException; @@ -359,7 +360,7 @@ public function loadContentVersions($contentId, Request $request) $contentInfo = $this->repository->getContentService()->loadContentInfo($contentId); return new Values\VersionList( - $this->repository->getContentService()->loadVersions($contentInfo), + iterator_to_array($this->repository->getContentService()->loadVersions($contentInfo)), $request->getPathInfo() ); } diff --git a/src/lib/Server/Input/Parser/Query.php b/src/lib/Server/Input/Parser/Query.php index 6b144084..1ff0d23e 100644 --- a/src/lib/Server/Input/Parser/Query.php +++ b/src/lib/Server/Input/Parser/Query.php @@ -8,6 +8,7 @@ namespace Ibexa\Rest\Server\Input\Parser; use Ibexa\Contracts\Core\Repository\Values\Content\Query\Criterion as CriterionValue; +use Ibexa\Contracts\Core\Repository\Values\Content\Query\CriterionInterface; use Ibexa\Contracts\Rest\Input\ParsingDispatcher; use Ibexa\Rest\Server\Input\Parser\Criterion as CriterionParser; @@ -89,11 +90,8 @@ abstract protected function buildQuery(); /** * @param array $criteriaArray - * @param \Ibexa\Contracts\Rest\Input\ParsingDispatcher $parsingDispatcher - * - * @return \Ibexa\Contracts\Core\Repository\Values\Content\Query\Criterion|null A criterion, or a LogicalAnd with a set of Criterion, or null if an empty array was given */ - private function processCriteriaArray(array $criteriaArray, ParsingDispatcher $parsingDispatcher) + private function processCriteriaArray(array $criteriaArray, ParsingDispatcher $parsingDispatcher): ?CriterionInterface { if (count($criteriaArray) === 0) { return null;