Skip to content

Commit d8347aa

Browse files
committed
MAGE-1281 Apply new naming convention per review
1 parent b2ed481 commit d8347aa

File tree

5 files changed

+17
-17
lines changed

5 files changed

+17
-17
lines changed

Helper/Entity/ProductHelper.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
use Algolia\AlgoliaSearch\Service\IndexOptionsBuilder;
1313
use Algolia\AlgoliaSearch\Service\Product\FacetBuilder;
1414
use Algolia\AlgoliaSearch\Service\Product\RecordBuilder as ProductRecordBuilder;
15-
use Algolia\AlgoliaSearch\Service\ReplicaSettingsHandler;
15+
use Algolia\AlgoliaSearch\Service\IndexSettingsHandler;
1616
use Magento\Catalog\Api\Data\ProductInterfaceFactory;
1717
use Magento\Catalog\Model\Product;
1818
use Magento\Catalog\Model\Product\Attribute\Source\Status;
@@ -88,7 +88,7 @@ public function __construct(
8888
protected ProductInterfaceFactory $productFactory,
8989
protected ProductRecordBuilder $productRecordBuilder,
9090
protected FacetBuilder $facetBuilder,
91-
protected ReplicaSettingsHandler $replicaSettingsHandler,
91+
protected IndexSettingsHandler $indexSettingsHandler,
9292
)
9393
{
9494
parent::__construct($indexNameFetcher);
@@ -318,11 +318,11 @@ public function setSettings(
318318
): void {
319319
$indexSettings = $this->getIndexSettings($storeId);
320320

321-
$this->replicaSettingsHandler->setSettings($indexOptions, $indexSettings);
321+
$this->indexSettingsHandler->setSettings($indexOptions, $indexSettings);
322322

323323
$this->logger->log('Settings: ' . json_encode($indexSettings));
324324
if ($saveToTmpIndicesToo) {
325-
$this->replicaSettingsHandler->setSettings(
325+
$this->indexSettingsHandler->setSettings(
326326
$indexTmpOptions,
327327
$indexSettings,
328328
$indexOptions->getIndexName()

Model/IndicesConfigurator.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
use Algolia\AlgoliaSearch\Service\Category\IndexOptionsBuilder as CategoryIndexOptionsBuilder;
1818
use Algolia\AlgoliaSearch\Service\Page\IndexOptionsBuilder as PageIndexOptionsBuilder;
1919
use Algolia\AlgoliaSearch\Service\Product\IndexOptionsBuilder as ProductIndexOptionsBuilder;
20-
use Algolia\AlgoliaSearch\Service\ReplicaSettingsHandler;
20+
use Algolia\AlgoliaSearch\Service\IndexSettingsHandler;
2121
use Algolia\AlgoliaSearch\Service\Suggestion\IndexOptionsBuilder as SuggestionIndexOptionsBuilder;
2222
use Magento\Framework\Exception\NoSuchEntityException;
2323

@@ -38,7 +38,7 @@ public function __construct(
3838
protected SuggestionHelper $suggestionHelper,
3939
protected AdditionalSectionHelper $additionalSectionHelper,
4040
protected AlgoliaCredentialsManager $algoliaCredentialsManager,
41-
protected ReplicaSettingsHandler $replicaSettingsHandler,
41+
protected IndexSettingsHandler $indexSettingsHandler,
4242
protected DiagnosticsLogger $logger
4343
) {}
4444

@@ -110,7 +110,7 @@ protected function setCategoriesSettings(int $storeId): void
110110
$settings = $this->categoryHelper->getIndexSettings($storeId);
111111
$indexOptions = $this->categoryIndexOptionsBuilder->buildEntityIndexOptions($storeId);
112112

113-
$this->replicaSettingsHandler->setSettings($indexOptions, $settings);
113+
$this->indexSettingsHandler->setSettings($indexOptions, $settings);
114114

115115
$this->logger->log('Index name: ' . $indexOptions->getIndexName());
116116
$this->logger->log('Settings: ' . json_encode($settings));
@@ -130,7 +130,7 @@ protected function setPagesSettings(int $storeId): void
130130
$settings = $this->pageHelper->getIndexSettings($storeId);
131131
$indexOptions = $this->pageIndexOptionsBuilder->buildEntityIndexOptions($storeId);
132132

133-
$this->replicaSettingsHandler->setSettings($indexOptions, $settings);
133+
$this->indexSettingsHandler->setSettings($indexOptions, $settings);
134134

135135
$this->logger->log('Index name: ' . $indexOptions->getIndexName());
136136
$this->logger->log('Settings: ' . json_encode($settings));
@@ -150,7 +150,7 @@ protected function setQuerySuggestionsSettings(int $storeId): void
150150
$settings = $this->suggestionHelper->getIndexSettings($storeId);
151151
$indexOptions = $this->suggestionIndexOptionsBuilder->buildEntityIndexOptions($storeId);
152152

153-
$this->replicaSettingsHandler->setSettings($indexOptions, $settings);
153+
$this->indexSettingsHandler->setSettings($indexOptions, $settings);
154154

155155
$this->logger->log('Index name: ' . $indexOptions->getIndexName());
156156
$this->logger->log('Settings: ' . json_encode($settings));
@@ -179,7 +179,7 @@ protected function setAdditionalSectionsSettings(int $storeId): void
179179
$settings = $this->additionalSectionHelper->getIndexSettings($storeId);
180180
$indexOptions = $this->indexOptionsBuilder->buildWithEnforcedIndex($indexName, $storeId);
181181

182-
$this->replicaSettingsHandler->setSettings($indexOptions, $settings);
182+
$this->indexSettingsHandler->setSettings($indexOptions, $settings);
183183

184184
$this->logger->log('Index name: ' . $indexName);
185185
$this->logger->log('Settings: ' . json_encode($settings));

Service/ReplicaSettingsHandler.php renamed to Service/IndexSettingsHandler.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
* This class will proxy the settings save operations and forward to replicas based on user configuration
1212
* excluding attributes which should never be forwarded
1313
*/
14-
class ReplicaSettingsHandler
14+
class IndexSettingsHandler
1515
{
1616
/**
1717
* As replicas are used for sorting we do not want to override these replicas specific configurations

Test/Unit/Service/ReplicaSettingsHandlerTest.php renamed to Test/Unit/Service/IndexSettingsHandlerTest.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,26 +5,26 @@
55
use Algolia\AlgoliaSearch\Api\Data\IndexOptionsInterface;
66
use Algolia\AlgoliaSearch\Helper\ConfigHelper;
77
use Algolia\AlgoliaSearch\Service\AlgoliaConnector;
8-
use Algolia\AlgoliaSearch\Service\ReplicaSettingsHandler;
8+
use Algolia\AlgoliaSearch\Service\IndexSettingsHandler;
99
use PHPUnit\Framework\TestCase;
1010

11-
class ReplicaSettingsHandlerTest extends TestCase
11+
class IndexSettingsHandlerTest extends TestCase
1212
{
1313
protected ?AlgoliaConnector $connector = null;
1414

1515
protected ?ConfigHelper $config = null;
1616

1717
protected ?IndexOptionsInterface $indexOptions = null;
1818

19-
private ?ReplicaSettingsHandler $handler = null;
19+
private ?IndexSettingsHandler $handler = null;
2020

2121
protected function setUp(): void
2222
{
2323
$this->connector = $this->createMock(AlgoliaConnector::class);
2424
$this->config = $this->createMock(ConfigHelper::class);
2525
$this->indexOptions = $this->createMock(IndexOptionsInterface::class);
2626

27-
$this->handler = new ReplicaSettingsHandlerTestable($this->connector, $this->config);
27+
$this->handler = new IndexSettingsHandlerTestable($this->connector, $this->config);
2828
}
2929

3030
public function testSetSettingsWithForwardingEnabledAndMixedSettings(): void

Test/Unit/Service/ReplicaSettingsHandlerTestable.php renamed to Test/Unit/Service/IndexSettingsHandlerTestable.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22

33
namespace Algolia\AlgoliaSearch\Test\Unit\Service;
44

5-
use Algolia\AlgoliaSearch\Service\ReplicaSettingsHandler;
5+
use Algolia\AlgoliaSearch\Service\IndexSettingsHandler;
66

7-
class ReplicaSettingsHandlerTestable extends ReplicaSettingsHandler
7+
class IndexSettingsHandlerTestable extends IndexSettingsHandler
88
{
99
public function splitSettings(...$params): array
1010
{

0 commit comments

Comments
 (0)