From 7e59b8fbd2d559e23b294f312db5f53c4892f657 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Noco=C5=84?= Date: Tue, 10 Dec 2024 18:46:17 +0100 Subject: [PATCH] [v5] Moved from Criterion to CriterionInterface --- .../Criterion/Elasticsearch/CameraManufacturerVisitor.php | 6 +++--- .../src/Query/Criterion/Solr/CameraManufacturerVisitor.php | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/code_samples/search/elasticsearch/src/Query/Criterion/Elasticsearch/CameraManufacturerVisitor.php b/code_samples/search/elasticsearch/src/Query/Criterion/Elasticsearch/CameraManufacturerVisitor.php index 62e4d4f495..862bd94bf4 100644 --- a/code_samples/search/elasticsearch/src/Query/Criterion/Elasticsearch/CameraManufacturerVisitor.php +++ b/code_samples/search/elasticsearch/src/Query/Criterion/Elasticsearch/CameraManufacturerVisitor.php @@ -4,18 +4,18 @@ namespace App\Query\Criterion\Elasticsearch; -use Ibexa\Contracts\Core\Repository\Values\Content\Query\Criterion; +use Ibexa\Contracts\Core\Repository\Values\Content\Query\CriterionInterface; use Ibexa\Contracts\Elasticsearch\Query\CriterionVisitor; use Ibexa\Contracts\Elasticsearch\Query\LanguageFilter; final class CameraManufacturerVisitor implements CriterionVisitor { - public function supports(Criterion $criterion, LanguageFilter $languageFilter): bool + public function supports(CriterionInterface $criterion, LanguageFilter $languageFilter): bool { return $criterion instanceof CameraManufacturerCriterion; } - public function visit(CriterionVisitor $dispatcher, Criterion $criterion, LanguageFilter $languageFilter): array + public function visit(CriterionVisitor $dispatcher, CriterionInterface $criterion, LanguageFilter $languageFilter): array { return [ 'terms' => [ diff --git a/code_samples/search/solr/src/Query/Criterion/Solr/CameraManufacturerVisitor.php b/code_samples/search/solr/src/Query/Criterion/Solr/CameraManufacturerVisitor.php index c5ae4bacfd..7d7f4f81be 100644 --- a/code_samples/search/solr/src/Query/Criterion/Solr/CameraManufacturerVisitor.php +++ b/code_samples/search/solr/src/Query/Criterion/Solr/CameraManufacturerVisitor.php @@ -4,17 +4,17 @@ namespace App\Query\Criterion\Solr; -use Ibexa\Contracts\Core\Repository\Values\Content\Query\Criterion; +use Ibexa\Contracts\Core\Repository\Values\Content\Query\CriterionInterface; use Ibexa\Contracts\Solr\Query\CriterionVisitor; final class CameraManufacturerVisitor extends CriterionVisitor { - public function canVisit(Criterion $criterion) + public function canVisit(CriterionInterface $criterion) { return $criterion instanceof CameraManufacturerCriterion; } - public function visit(Criterion $criterion, CriterionVisitor $subVisitor = null) + public function visit(CriterionInterface $criterion, CriterionVisitor $subVisitor = null) { $expressions = array_map( function ($value): string {