Skip to content

Commit

Permalink
Apply php-cs-fixer changes
Browse files Browse the repository at this point in the history
  • Loading branch information
markus-moser authored and github-actions[bot] committed May 24, 2024
1 parent 59a7c5c commit d477d5f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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()),
Expand All @@ -60,8 +55,7 @@ public function handleRequiredByFilter(
public function handleRequiresFilter(
RequiresFilter $requiresFilter,
SearchModifierContextInterface $context
): void
{
): void {
$element = $this->elementSearchService->byId(
$requiresFilter->getElementType(),
$requiresFilter->getId(),
Expand All @@ -86,8 +80,8 @@ public function handleRequiresFilter(
new TermFilter(
field: SystemField::ELEMENT_TYPE->getPath(),
term: ElementType::fromShortValue($elementType)->value,
)
]
),
],
]))->toArray(true)
);
}
Expand All @@ -100,6 +94,7 @@ public function handleRequiresFilter(
term: 0,
)
);

return;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -90,6 +89,4 @@ public function byId(ElementType $elementType, int $id, ?User $user = null): ?El
}

}


}

0 comments on commit d477d5f

Please sign in to comment.