From d477d5f77c5b66ebe1f496a23ea5233841de40df Mon Sep 17 00:00:00 2001 From: markus-moser Date: Fri, 24 May 2024 13:40:07 +0000 Subject: [PATCH] Apply php-cs-fixer changes --- .../Modifier/Filter/DependencyFilters.php | 17 ++++++----------- .../Element/ElementSearchService.php | 3 --- 2 files changed, 6 insertions(+), 14 deletions(-) diff --git a/src/SearchIndexAdapter/OpenSearch/Search/Modifier/Filter/DependencyFilters.php b/src/SearchIndexAdapter/OpenSearch/Search/Modifier/Filter/DependencyFilters.php index e34932e6..b05f0fa8 100644 --- a/src/SearchIndexAdapter/OpenSearch/Search/Modifier/Filter/DependencyFilters.php +++ b/src/SearchIndexAdapter/OpenSearch/Search/Modifier/Filter/DependencyFilters.php @@ -24,9 +24,6 @@ use Pimcore\Bundle\GenericDataIndexBundle\Model\OpenSearch\Query\BoolQuery; use Pimcore\Bundle\GenericDataIndexBundle\Model\OpenSearch\Query\TermFilter; use Pimcore\Bundle\GenericDataIndexBundle\Model\OpenSearch\Query\TermsFilter; -use Pimcore\Bundle\GenericDataIndexBundle\Model\Search\Modifier\Filter\Basic\ExcludeFoldersFilter; -use Pimcore\Bundle\GenericDataIndexBundle\Model\Search\Modifier\Filter\Basic\IdFilter; -use Pimcore\Bundle\GenericDataIndexBundle\Model\Search\Modifier\Filter\Basic\IdsFilter; use Pimcore\Bundle\GenericDataIndexBundle\Model\Search\Modifier\Filter\Dependency\RequiredByFilter; use Pimcore\Bundle\GenericDataIndexBundle\Model\Search\Modifier\Filter\Dependency\RequiresFilter; use Pimcore\Bundle\GenericDataIndexBundle\Service\Search\SearchService\Element\ElementSearchServiceInterface; @@ -38,16 +35,14 @@ { public function __construct( private ElementSearchServiceInterface $elementSearchService, - ) - { + ) { } #[AsSearchModifierHandler] public function handleRequiredByFilter( RequiredByFilter $requiredByFilter, SearchModifierContextInterface $context - ): void - { + ): void { $context->getSearch()->addQuery( new TermFilter( field: SystemField::DEPENDENCIES->getPath($requiredByFilter->getElementType()->getShortValue()), @@ -60,8 +55,7 @@ public function handleRequiredByFilter( public function handleRequiresFilter( RequiresFilter $requiresFilter, SearchModifierContextInterface $context - ): void - { + ): void { $element = $this->elementSearchService->byId( $requiresFilter->getElementType(), $requiresFilter->getId(), @@ -86,8 +80,8 @@ public function handleRequiresFilter( new TermFilter( field: SystemField::ELEMENT_TYPE->getPath(), term: ElementType::fromShortValue($elementType)->value, - ) - ] + ), + ], ]))->toArray(true) ); } @@ -100,6 +94,7 @@ public function handleRequiresFilter( term: 0, ) ); + return; } diff --git a/src/Service/Search/SearchService/Element/ElementSearchService.php b/src/Service/Search/SearchService/Element/ElementSearchService.php index ec243d19..81f0d19d 100644 --- a/src/Service/Search/SearchService/Element/ElementSearchService.php +++ b/src/Service/Search/SearchService/Element/ElementSearchService.php @@ -19,7 +19,6 @@ use Exception; use Pimcore\Bundle\GenericDataIndexBundle\Enum\SearchIndex\ElementType; use Pimcore\Bundle\GenericDataIndexBundle\Exception\ElementSearchException; -use Pimcore\Bundle\GenericDataIndexBundle\Model\Search\DataObject\DataObjectSearchInterface; use Pimcore\Bundle\GenericDataIndexBundle\Model\Search\Element\SearchResult\ElementSearchResult; use Pimcore\Bundle\GenericDataIndexBundle\Model\Search\Interfaces\ElementSearchResultItemInterface; use Pimcore\Bundle\GenericDataIndexBundle\Model\Search\Interfaces\SearchInterface; @@ -90,6 +89,4 @@ public function byId(ElementType $elementType, int $id, ?User $user = null): ?El } } - - }