Skip to content

Commit

Permalink
refactor: rename IndexerFilter to ResourceFilter
Browse files Browse the repository at this point in the history
  • Loading branch information
sitepark-veltrup committed Mar 22, 2024
1 parent 3d819f0 commit 795241f
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 11 deletions.
4 changes: 2 additions & 2 deletions src/Service/Indexer/InternalResourceIndexer.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ class InternalResourceIndexer implements Indexer
*/
public function __construct(
private readonly iterable $documentEnricherList,
private readonly IndexerFilter $indexerFilter,
private readonly ResourceFilter $resourceFilter,
private readonly IndexerProgressHandler $indexerProgressHandler,
private readonly LocationFinder $finder,
private readonly ResourceLoader $resourceLoader,
Expand Down Expand Up @@ -349,7 +349,7 @@ private function add(
$updater = $this->indexService->updater($lang);

foreach ($resources as $resource) {
if ($this->indexerFilter->accept($resource) === false) {
if ($this->resourceFilter->accept($resource) === false) {
$this->indexerProgressHandler->skip(1);
continue;
}
Expand Down
2 changes: 1 addition & 1 deletion src/Service/Indexer/InternalResourceIndexerFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ class InternalResourceIndexerFactory
*/
public function __construct(
private readonly iterable $documentEnricherList,
private readonly IndexerFilter $indexerFilter,
private readonly ResourceFilter $indexerFilter,
private readonly LocationFinder $finder,
private readonly ResourceLoader $resourceLoader,
private readonly TranslationSplitter $translationSplitter,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

use Atoolo\Resource\Resource;

interface IndexerFilter
interface ResourceFilter
{
public function accept(Resource $resource): bool;
}
4 changes: 2 additions & 2 deletions src/Service/Indexer/SiteKit/NoIndexFilter.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
namespace Atoolo\Search\Service\Indexer\SiteKit;

use Atoolo\Resource\Resource;
use Atoolo\Search\Service\Indexer\IndexerFilter;
use Atoolo\Search\Service\Indexer\ResourceFilter;

class NoIndexFilter implements IndexerFilter
class NoIndexFilter implements ResourceFilter
{
public function accept(Resource $resource): bool
{
Expand Down
4 changes: 2 additions & 2 deletions test/Service/Indexer/InternalResourceIndexerFactoryTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@
namespace Atoolo\Search\Test\Service\Indexer;

use Atoolo\Resource\ResourceLoader;
use Atoolo\Search\Service\Indexer\IndexerFilter;
use Atoolo\Search\Service\Indexer\IndexerProgressHandler;
use Atoolo\Search\Service\Indexer\IndexingAborter;
use Atoolo\Search\Service\Indexer\InternalResourceIndexerFactory;
use Atoolo\Search\Service\Indexer\LocationFinder;
use Atoolo\Search\Service\Indexer\ResourceFilter;
use Atoolo\Search\Service\Indexer\SolrIndexService;
use Atoolo\Search\Service\Indexer\TranslationSplitter;
use PHPUnit\Framework\TestCase;
Expand All @@ -20,7 +20,7 @@ public function testCreate(): void
{
$factory = new InternalResourceIndexerFactory(
[],
$this->createStub(IndexerFilter::class),
$this->createStub(ResourceFilter::class),
$this->createStub(LocationFinder::class),
$this->createStub(ResourceLoader::class),
$this->createStub(TranslationSplitter::class),
Expand Down
6 changes: 3 additions & 3 deletions test/Service/Indexer/InternalResourceIndexerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@
use Atoolo\Resource\ResourceLoader;
use Atoolo\Search\Dto\Indexer\IndexerParameter;
use Atoolo\Search\Service\Indexer\DocumentEnricher;
use Atoolo\Search\Service\Indexer\IndexerFilter;
use Atoolo\Search\Service\Indexer\IndexerProgressHandler;
use Atoolo\Search\Service\Indexer\IndexingAborter;
use Atoolo\Search\Service\Indexer\IndexSchema2xDocument;
use Atoolo\Search\Service\Indexer\InternalResourceIndexer;
use Atoolo\Search\Service\Indexer\LocationFinder;
use Atoolo\Search\Service\Indexer\ResourceFilter;
use Atoolo\Search\Service\Indexer\SiteKit\SubDirTranslationSplitter;
use Atoolo\Search\Service\Indexer\SolrIndexService;
use Atoolo\Search\Service\Indexer\SolrIndexUpdater;
Expand All @@ -32,7 +32,7 @@ class InternalResourceIndexerTest extends TestCase
*/
private array $availableIndexes = ['test', 'test-en_US'];

public IndexerFilter&MockObject $indexerFilter;
public ResourceFilter&MockObject $indexerFilter;

private ResourceLoader&Stub $resourceLoader;

Expand Down Expand Up @@ -60,7 +60,7 @@ class InternalResourceIndexerTest extends TestCase
public function setUp(): void
{
$this->indexerFilter = $this->createMock(
IndexerFilter::class
ResourceFilter::class
);

$this->indexerProgressHandler = $this->createMock(
Expand Down

0 comments on commit 795241f

Please sign in to comment.