From 4db8921565e814022b74b814c674b4835a1e554d Mon Sep 17 00:00:00 2001 From: Dawid Parafinski Date: Mon, 21 Oct 2024 13:47:21 +0200 Subject: [PATCH 1/6] IBX-8536: Replaced deprecated graphql methods --- src/lib/GraphQL/ContentQueryFieldDefinitionMapper.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/lib/GraphQL/ContentQueryFieldDefinitionMapper.php b/src/lib/GraphQL/ContentQueryFieldDefinitionMapper.php index 093ac96..beb09da 100644 --- a/src/lib/GraphQL/ContentQueryFieldDefinitionMapper.php +++ b/src/lib/GraphQL/ContentQueryFieldDefinitionMapper.php @@ -95,14 +95,14 @@ protected function getFieldTypeIdentifier(): string private function nameValueType($typeIdentifier): string { - return $this->nameHelper->domainContentName( + return $this->nameHelper->itemName( $this->contentTypeService->loadContentTypeByIdentifier($typeIdentifier) ); } private function nameValueConnectionType($typeIdentifier): string { - return $this->nameHelper->domainContentConnection( + return $this->nameHelper->itemConnectionName( $this->contentTypeService->loadContentTypeByIdentifier($typeIdentifier) ); } From 8d86c0503cf8935654deb61f2eed90f0f728a8d9 Mon Sep 17 00:00:00 2001 From: Dawid Parafinski Date: Mon, 21 Oct 2024 13:49:48 +0200 Subject: [PATCH 2/6] Dropped deprecated interface --- src/lib/QueryFieldPaginationService.php | 17 ----------------- 1 file changed, 17 deletions(-) delete mode 100644 src/lib/QueryFieldPaginationService.php diff --git a/src/lib/QueryFieldPaginationService.php b/src/lib/QueryFieldPaginationService.php deleted file mode 100644 index 76c9144..0000000 --- a/src/lib/QueryFieldPaginationService.php +++ /dev/null @@ -1,17 +0,0 @@ - Date: Mon, 21 Oct 2024 13:50:29 +0200 Subject: [PATCH 3/6] Dropped deprecated factory method --- .../FieldValue/Converter/QueryConverter.php | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/src/lib/Persistence/Legacy/Content/FieldValue/Converter/QueryConverter.php b/src/lib/Persistence/Legacy/Content/FieldValue/Converter/QueryConverter.php index 32bd2b7..f839d71 100644 --- a/src/lib/Persistence/Legacy/Content/FieldValue/Converter/QueryConverter.php +++ b/src/lib/Persistence/Legacy/Content/FieldValue/Converter/QueryConverter.php @@ -15,20 +15,6 @@ class QueryConverter implements Converter { - /** - * Factory for current class. - * - * Note: Class should instead be configured as service if it gains dependencies. - * - * @deprecated since 6.8, will be removed in 7.x, use default constructor instead. - * - * @return \Ibexa\FieldTypeQuery\Persistence\Legacy\Content\FieldValue\Converter\QueryConverter - */ - public static function create() - { - return new self(); - } - /** * Converts data from $value to $storageFieldValue. * From eab919b190da56210af9b646aa88a08000e642c4 Mon Sep 17 00:00:00 2001 From: Dawid Parafinski Date: Mon, 21 Oct 2024 13:51:01 +0200 Subject: [PATCH 4/6] Cleanup constructor --- spec/QueryFieldServiceSpec.php | 4 +--- src/lib/QueryFieldService.php | 7 ------- 2 files changed, 1 insertion(+), 10 deletions(-) diff --git a/spec/QueryFieldServiceSpec.php b/spec/QueryFieldServiceSpec.php index a3c1071..1530663 100644 --- a/spec/QueryFieldServiceSpec.php +++ b/spec/QueryFieldServiceSpec.php @@ -39,7 +39,6 @@ class QueryFieldServiceSpec extends ObjectBehavior public function let( SearchService $searchService, ContentTypeService $contentTypeService, - LocationService $locationService, QueryTypeRegistry $queryTypeRegistry, QueryType $queryType ) { @@ -61,12 +60,11 @@ public function let( $contentTypeWithoutPagination = $this->getContentType($parameters, false, 10); $contentTypeService->loadContentType(self::CONTENT_TYPE_ID_WITHOUT_PAGINATION)->willReturn($contentTypeWithoutPagination); - $locationService->loadLocation(self::LOCATION_ID)->willReturn($location); $queryTypeRegistry->getQueryType(self::QUERY_TYPE_IDENTIFIER)->willReturn($queryType); $queryType->getQuery(Argument::any())->willReturn(new ApiQuery()); // @todo this should fail. It does not. $searchService->findContent(Argument::any())->willReturn($this->searchResult); - $this->beConstructedWith($searchService, $contentTypeService, $locationService, $queryTypeRegistry); + $this->beConstructedWith($searchService, $contentTypeService, $queryTypeRegistry); } public function it_is_initializable() diff --git a/src/lib/QueryFieldService.php b/src/lib/QueryFieldService.php index 87b89ac..9f4358d 100644 --- a/src/lib/QueryFieldService.php +++ b/src/lib/QueryFieldService.php @@ -36,20 +36,13 @@ final class QueryFieldService implements QueryFieldServiceInterface, QueryFieldL /** @var \Ibexa\Contracts\Core\Repository\ContentTypeService */ private $contentTypeService; - /** - * @var \Ibexa\Contracts\Core\Repository\LocationService - */ - private $locationService; - public function __construct( SearchService $searchService, ContentTypeService $contentTypeService, - LocationService $locationService, QueryTypeRegistry $queryTypeRegistry ) { $this->searchService = $searchService; $this->contentTypeService = $contentTypeService; - $this->locationService = $locationService; $this->queryTypeRegistry = $queryTypeRegistry; } From 1506307dc664e2619502c1fa59fbc4557222cf1a Mon Sep 17 00:00:00 2001 From: Dawid Parafinski Date: Mon, 21 Oct 2024 14:06:54 +0200 Subject: [PATCH 5/6] fix cs --- spec/QueryFieldServiceSpec.php | 5 ----- src/lib/QueryFieldService.php | 1 - 2 files changed, 6 deletions(-) diff --git a/spec/QueryFieldServiceSpec.php b/spec/QueryFieldServiceSpec.php index 1530663..aa6c604 100644 --- a/spec/QueryFieldServiceSpec.php +++ b/spec/QueryFieldServiceSpec.php @@ -8,7 +8,6 @@ namespace spec\Ibexa\FieldTypeQuery; use Ibexa\Contracts\Core\Repository\ContentTypeService; -use Ibexa\Contracts\Core\Repository\LocationService; use Ibexa\Contracts\Core\Repository\SearchService; use Ibexa\Contracts\Core\Repository\Values\Content\ContentInfo; use Ibexa\Contracts\Core\Repository\Values\Content\Query as ApiContentQuery; @@ -50,10 +49,6 @@ public function let( 'param2' => 'value2', ]; - $location = new Values\Content\Location([ - 'id' => self::LOCATION_ID, - ]); - $contentTypeWithPagination = $this->getContentType($parameters); $contentTypeService->loadContentType(self::CONTENT_TYPE_ID)->willReturn($contentTypeWithPagination); diff --git a/src/lib/QueryFieldService.php b/src/lib/QueryFieldService.php index 9f4358d..401bd9d 100644 --- a/src/lib/QueryFieldService.php +++ b/src/lib/QueryFieldService.php @@ -8,7 +8,6 @@ namespace Ibexa\FieldTypeQuery; use Ibexa\Contracts\Core\Repository\ContentTypeService; -use Ibexa\Contracts\Core\Repository\LocationService; use Ibexa\Contracts\Core\Repository\SearchService; use Ibexa\Contracts\Core\Repository\Values\Content\Content; use Ibexa\Contracts\Core\Repository\Values\Content\Location; From 4fa00e8ab7dc27ba91272f5f9d3b3e50533f246b Mon Sep 17 00:00:00 2001 From: Dawid Parafinski Date: Mon, 21 Oct 2024 14:11:50 +0200 Subject: [PATCH 6/6] fixed spec --- spec/GraphQL/ContentQueryFieldDefinitionMapperSpec.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spec/GraphQL/ContentQueryFieldDefinitionMapperSpec.php b/spec/GraphQL/ContentQueryFieldDefinitionMapperSpec.php index c696fc8..b21b17d 100644 --- a/spec/GraphQL/ContentQueryFieldDefinitionMapperSpec.php +++ b/spec/GraphQL/ContentQueryFieldDefinitionMapperSpec.php @@ -34,7 +34,7 @@ public function let( ->willReturn($contentType); $nameHelper - ->domainContentName($contentType) + ->itemName($contentType) ->willReturn(self::GRAPHQL_TYPE); $this->beConstructedWith($innerMapper, $nameHelper, $contentTypeService, self::FIELD_TYPE_IDENTIFIER);