Skip to content

Commit

Permalink
Cleanup constructor
Browse files Browse the repository at this point in the history
  • Loading branch information
ViniTou committed Oct 21, 2024
1 parent fd1a274 commit eab919b
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 10 deletions.
4 changes: 1 addition & 3 deletions spec/QueryFieldServiceSpec.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ class QueryFieldServiceSpec extends ObjectBehavior
public function let(
SearchService $searchService,
ContentTypeService $contentTypeService,
LocationService $locationService,
QueryTypeRegistry $queryTypeRegistry,
QueryType $queryType
) {
Expand All @@ -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()
Expand Down
7 changes: 0 additions & 7 deletions src/lib/QueryFieldService.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down

0 comments on commit eab919b

Please sign in to comment.