diff --git a/phpstan-baseline.neon b/phpstan-baseline.neon index f3fca47..e068e8f 100644 --- a/phpstan-baseline.neon +++ b/phpstan-baseline.neon @@ -1,13 +1,13 @@ parameters: ignoreErrors: - - message: '#^Parameter \#1 \$href of method Ibexa\\Rest\\RequestParser\:\:parseHref\(\) expects string, string\|null given\.$#' + message: '#^Parameter \#1 \$locationId of method Ibexa\\Contracts\\Core\\Repository\\LocationService\:\:loadLocation\(\) expects int, int\|null given\.$#' identifier: argument.type count: 1 path: src/bundle/Controller/QueryFieldRestController.php - - message: '#^Parameter \#1 \$locationId of method Ibexa\\Contracts\\Core\\Repository\\LocationService\:\:loadLocation\(\) expects int, int\|null given\.$#' + message: '#^Parameter \#1 \$uri of method Ibexa\\Contracts\\Rest\\UriParser\\UriParserInterface\:\:getAttributeFromUri\(\) expects string, string\|null given\.$#' identifier: argument.type count: 1 path: src/bundle/Controller/QueryFieldRestController.php diff --git a/src/bundle/Controller/QueryFieldRestController.php b/src/bundle/Controller/QueryFieldRestController.php index 9e5804f..e4e0aff 100644 --- a/src/bundle/Controller/QueryFieldRestController.php +++ b/src/bundle/Controller/QueryFieldRestController.php @@ -37,18 +37,22 @@ final class QueryFieldRestController private UriParserInterface $uriParser; + private ContentService\RelationListFacadeInterface $relationListFacade; + public function __construct( QueryFieldService $queryFieldService, ContentService $contentService, ContentTypeService $contentTypeService, LocationService $locationService, - UriParserInterface $uriParser + UriParserInterface $uriParser, + ContentService\RelationListFacadeInterface $relationListFacade ) { $this->queryFieldService = $queryFieldService; $this->contentService = $contentService; $this->contentTypeService = $contentTypeService; $this->locationService = $locationService; $this->uriParser = $uriParser; + $this->relationListFacade = $relationListFacade; } public function getResults( @@ -94,7 +98,7 @@ function (Content $content) { $this->locationService->loadLocation($content->contentInfo->mainLocationId), $content, $this->getContentType($content->contentInfo), - iterator_to_array($this->contentService->loadRelations($content->getVersionInfo())) + iterator_to_array($this->relationListFacade->getRelations($content->getVersionInfo())) ); }, iterator_to_array($items) diff --git a/src/lib/Persistence/Legacy/Content/FieldValue/Converter/QueryConverter.php b/src/lib/Persistence/Legacy/Content/FieldValue/Converter/QueryConverter.php index fe2801a..13f97c6 100644 --- a/src/lib/Persistence/Legacy/Content/FieldValue/Converter/QueryConverter.php +++ b/src/lib/Persistence/Legacy/Content/FieldValue/Converter/QueryConverter.php @@ -21,7 +21,7 @@ class QueryConverter implements Converter * @param \Ibexa\Contracts\Core\Persistence\Content\FieldValue $value * @param \Ibexa\Core\Persistence\Legacy\Content\StorageFieldValue $storageFieldValue */ - public function toStorageValue(FieldValue $value, StorageFieldValue $storageFieldValue) + public function toStorageValue(FieldValue $value, StorageFieldValue $storageFieldValue): void { $storageFieldValue->dataText = $value->data; $storageFieldValue->sortKeyString = (string)$value->sortKey;