From 040573d23217dc041e942f61fe225bd9a29825d3 Mon Sep 17 00:00:00 2001 From: tischsoic Date: Fri, 19 Apr 2024 14:00:50 +0200 Subject: [PATCH] aftre huddle review - BaseIsContainer --- .../{CommonIsContainer.php => BaseIsContainer.php} | 6 +++++- .../CriterionVisitor/CommonCriterionVisitor.php | 14 -------------- .../Query/Content/CriterionVisitor/IsContainer.php | 4 ++-- .../Location/CriterionVisitor/IsContainer.php | 4 ++-- 4 files changed, 9 insertions(+), 19 deletions(-) rename src/lib/Query/Common/CriterionVisitor/{CommonIsContainer.php => BaseIsContainer.php} (88%) delete mode 100644 src/lib/Query/Common/CriterionVisitor/CommonCriterionVisitor.php diff --git a/src/lib/Query/Common/CriterionVisitor/CommonIsContainer.php b/src/lib/Query/Common/CriterionVisitor/BaseIsContainer.php similarity index 88% rename from src/lib/Query/Common/CriterionVisitor/CommonIsContainer.php rename to src/lib/Query/Common/CriterionVisitor/BaseIsContainer.php index 78f02e2d..2d6dfd6d 100644 --- a/src/lib/Query/Common/CriterionVisitor/CommonIsContainer.php +++ b/src/lib/Query/Common/CriterionVisitor/BaseIsContainer.php @@ -4,14 +4,18 @@ * @copyright Copyright (C) Ibexa AS. All rights reserved. * @license For full copyright and license information view LICENSE file distributed with this source code. */ +declare(strict_types=1); + namespace Ibexa\Solr\Query\Common\CriterionVisitor; use Ibexa\Contracts\Core\Repository\Values\Content\Query\Criterion; use Ibexa\Contracts\Core\Repository\Values\Content\Query\Criterion\Operator; use Ibexa\Contracts\Solr\Query\CriterionVisitor; -abstract class CommonIsContainer extends CommonCriterionVisitor +abstract class BaseIsContainer extends CriterionVisitor { + abstract protected function getTargetField(): string; + public function canVisit(Criterion $criterion): bool { return $criterion instanceof Criterion\IsContainer && $criterion->operator === Operator::EQ; diff --git a/src/lib/Query/Common/CriterionVisitor/CommonCriterionVisitor.php b/src/lib/Query/Common/CriterionVisitor/CommonCriterionVisitor.php deleted file mode 100644 index 682c137a..00000000 --- a/src/lib/Query/Common/CriterionVisitor/CommonCriterionVisitor.php +++ /dev/null @@ -1,14 +0,0 @@ -