From 242c169323e5e0db0ea86661acaceb595eccb6d2 Mon Sep 17 00:00:00 2001 From: veltrup Date: Thu, 18 Jan 2024 09:51:55 +0100 Subject: [PATCH] refactor: DefaultSchema21DocumentEnricher -> DocumentEnricherSiteKitSchema2x --- config/services.yml | 2 +- src/Console/Command/Indexer.php | 4 ++-- ...cumentEnricher.php => DefaultSchema2xDocumentEnricher.php} | 3 +-- ...Schema21DocumentTest.php => IndexSchema2xDocumentTest.php} | 2 +- 4 files changed, 5 insertions(+), 6 deletions(-) rename src/Service/Indexer/SiteKit/{DefaultSchema21DocumentEnricher.php => DefaultSchema2xDocumentEnricher.php} (99%) rename test/Service/Indexer/{IndexSchema21DocumentTest.php => IndexSchema2xDocumentTest.php} (89%) diff --git a/config/services.yml b/config/services.yml index 5fdc303..3048dea 100644 --- a/config/services.yml +++ b/config/services.yml @@ -11,7 +11,7 @@ services: Atoolo\Search\Console\Command\Indexer: arguments: - - !tagged_iterator { tag: 'atoolo.search.indexer.documentEnricher' } + - !tagged_iterator { tag: 'atoolo.search.indexer.documentEnricher.schema2x' } Atoolo\Search\Console\Application: public: true diff --git a/src/Console/Command/Indexer.php b/src/Console/Command/Indexer.php index 0b367fb..c8eaaf9 100644 --- a/src/Console/Command/Indexer.php +++ b/src/Console/Command/Indexer.php @@ -12,7 +12,7 @@ use Atoolo\Search\Dto\Indexer\IndexerParameter; use Atoolo\Search\Service\Indexer\IndexingAborter; use Atoolo\Search\Service\Indexer\LocationFinder; -use Atoolo\Search\Service\Indexer\SiteKit\DefaultSchema21DocumentEnricher; +use Atoolo\Search\Service\Indexer\SiteKit\DefaultSchema2xDocumentEnricher; use Atoolo\Search\Service\Indexer\SiteKit\SubDirTranslationSplitter; use Atoolo\Search\Service\Indexer\SolrIndexer; use Atoolo\Search\Service\SolrParameterClientFactory; @@ -171,7 +171,7 @@ protected function createIndexer(): SolrIndexer $navigationLoader = new SiteKitNavigationHierarchyLoader( $resourceLoader ); - $schema21 = new DefaultSchema21DocumentEnricher( + $schema21 = new DefaultSchema2xDocumentEnricher( $navigationLoader ); diff --git a/src/Service/Indexer/SiteKit/DefaultSchema21DocumentEnricher.php b/src/Service/Indexer/SiteKit/DefaultSchema2xDocumentEnricher.php similarity index 99% rename from src/Service/Indexer/SiteKit/DefaultSchema21DocumentEnricher.php rename to src/Service/Indexer/SiteKit/DefaultSchema2xDocumentEnricher.php index eec98c6..e3b0175 100644 --- a/src/Service/Indexer/SiteKit/DefaultSchema21DocumentEnricher.php +++ b/src/Service/Indexer/SiteKit/DefaultSchema2xDocumentEnricher.php @@ -10,12 +10,11 @@ use Atoolo\Search\Service\Indexer\IndexDocument; use Atoolo\Search\Service\Indexer\IndexSchema2xDocument; use DateTime; -use Solarium\Core\Query\DocumentInterface; /** * @implements DocumentEnricher */ -class DefaultSchema21DocumentEnricher implements DocumentEnricher +class DefaultSchema2xDocumentEnricher implements DocumentEnricher { public function __construct( private readonly SiteKitNavigationHierarchyLoader $navigationLoader diff --git a/test/Service/Indexer/IndexSchema21DocumentTest.php b/test/Service/Indexer/IndexSchema2xDocumentTest.php similarity index 89% rename from test/Service/Indexer/IndexSchema21DocumentTest.php rename to test/Service/Indexer/IndexSchema2xDocumentTest.php index fc1d2a7..570079d 100644 --- a/test/Service/Indexer/IndexSchema21DocumentTest.php +++ b/test/Service/Indexer/IndexSchema2xDocumentTest.php @@ -7,7 +7,7 @@ use Atoolo\Search\Service\Indexer\IndexSchema2xDocument; use PHPUnit\Framework\TestCase; -class IndexSchema21DocumentTest extends TestCase +class IndexSchema2xDocumentTest extends TestCase { public function testGetFields(): void {