Skip to content

Commit 4140498

Browse files
BEG-81: Make commenting adhere to latest coding standards
1 parent 60981d2 commit 4140498

File tree

4 files changed

+55
-0
lines changed

4 files changed

+55
-0
lines changed

Helper/Config.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,18 @@ class Config
1717
/** @var ScopeConfigInterface */
1818
private ScopeConfigInterface $scopeConfig;
1919

20+
/**
21+
*
22+
* @param ScopeConfigInterface $scopeConfig
23+
*/
2024
public function __construct(ScopeConfigInterface $scopeConfig)
2125
{
2226
$this->scopeConfig = $scopeConfig;
2327
}
2428

2529
/**
30+
* Return if recaching functionality is enabled or not
31+
*
2632
* @param int|null $storeId
2733
* @return bool
2834
*/
@@ -36,6 +42,8 @@ public function isRecacheEnabled(?int $storeId = null): bool
3642
}
3743

3844
/**
45+
* Return configured Prerender.io token for API calls
46+
*
3947
* @param int|null $storeId
4048
* @return string|null
4149
*/

Model/Api/PrerenderClient.php

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,13 @@ class PrerenderClient implements PrerenderClientInterface
2727
/** @var LoggerInterface */
2828
private LoggerInterface $logger;
2929

30+
/**
31+
*
32+
* @param Config $prerenderConfigHelper
33+
* @param ClientInterface $client
34+
* @param SerializerInterface $jsonSerializer
35+
* @param LoggerInterface $logger
36+
*/
3037
public function __construct(
3138
Config $prerenderConfigHelper,
3239
ClientInterface $client,
@@ -40,6 +47,13 @@ public function __construct(
4047
$this->client->addHeader('content-type', 'application/json');
4148
}
4249

50+
/**
51+
* Call Prerender.io API to recache list of URLs
52+
*
53+
* @param array $urls
54+
* @param int $storeId
55+
* @return void
56+
*/
4357
public function recacheUrls(array $urls, int $storeId): void
4458
{
4559
if (!$this->prerenderConfigHelper->isRecacheEnabled($storeId)) {
@@ -57,6 +71,13 @@ public function recacheUrls(array $urls, int $storeId): void
5771
}
5872
}
5973

74+
/**
75+
* Sends a JSON POST request to Prerender.io
76+
*
77+
* @param array $urls
78+
* @param string $token
79+
* @return void
80+
*/
6081
private function sendRequest(array $urls, string $token): void
6182
{
6283
$payload = $this->jsonSerializer->serialize(

Model/Indexer/Product/ProductIndexer.php

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,15 @@ class ProductIndexer implements IndexerActionInterface, MviewActionInterface, Di
3838
/** @var int|null */
3939
private ?int $batchSize;
4040

41+
/**
42+
*
43+
* @param DimensionProviderInterface $dimensionProvider
44+
* @param GetUrlsForProducts $getUrlsForProducts
45+
* @param PrerenderClientInterface $prerenderClient
46+
* @param DeploymentConfig $deploymentConfig
47+
* @param Config $prerenderConfigHelper
48+
* @param int|null $batchSize
49+
*/
4150
public function __construct(
4251
DimensionProviderInterface $dimensionProvider,
4352
GetUrlsForProducts $getUrlsForProducts,
@@ -110,6 +119,10 @@ public function execute($ids): void
110119
}
111120

112121
/**
122+
* Execute indexing per dimension (store)
123+
*
124+
* @param arry $dimensions
125+
* @param \Traversable $entityIds
113126
* @throws FileSystemException
114127
* @throws RuntimeException
115128
*/

Model/Product/GetUrlsForProducts.php

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,12 @@ class GetUrlsForProducts
2222
/** @var Emulation */
2323
private Emulation $emulation;
2424

25+
/**
26+
*
27+
* @param CollectionFactory $productCollectionFactory
28+
* @param StoreManagerInterface $storeManager
29+
* @param Emulation $emulation
30+
*/
2531
public function __construct(
2632
CollectionFactory $productCollectionFactory,
2733
StoreManagerInterface $storeManager,
@@ -32,6 +38,13 @@ public function __construct(
3238
$this->emulation = $emulation;
3339
}
3440

41+
/**
42+
* Generate product URLs based on URL_REWRITE entries
43+
*
44+
* @param array $productIds
45+
* @param int $storeId
46+
* @return array
47+
*/
3548
public function execute(array $productIds, int $storeId): array
3649
{
3750
$productCollection = $this->productCollectionFactory->create();

0 commit comments

Comments
 (0)