Skip to content

Commit fcd118c

Browse files
authored
ENGCOM-4191: Updated sprintf usage; Simplified isset usage #21096
2 parents 3ca44d2 + 4598008 commit fcd118c

File tree

2 files changed

+14
-4
lines changed

2 files changed

+14
-4
lines changed

app/code/Magento/Catalog/Model/Indexer/Category/Flat/AbstractAction.php

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

99
use Magento\Framework\App\ResourceConnection;
1010

11+
/**
12+
* Abstract action class for category flat indexers.
13+
*/
1114
class AbstractAction
1215
{
1316
/**
@@ -130,7 +133,7 @@ protected function getFlatTableStructure($tableName)
130133
$table = $this->connection->newTable(
131134
$tableName
132135
)->setComment(
133-
sprintf("Catalog Category Flat", $tableName)
136+
'Catalog Category Flat'
134137
);
135138

136139
//Adding columns
@@ -378,7 +381,7 @@ protected function getAttributeValues($entityIds, $storeId)
378381
$linkField = $this->getCategoryMetadata()->getLinkField();
379382
foreach ($attributesType as $type) {
380383
foreach ($this->getAttributeTypeValues($type, $entityIds, $storeId) as $row) {
381-
if (isset($row[$linkField]) && isset($row['attribute_id'])) {
384+
if (isset($row[$linkField], $row['attribute_id'])) {
382385
$attributeId = $row['attribute_id'];
383386
if (isset($attributes[$attributeId])) {
384387
$attributeCode = $attributes[$attributeId]['attribute_code'];
@@ -496,6 +499,8 @@ protected function getTableName($name)
496499
}
497500

498501
/**
502+
* Get category metadata instance.
503+
*
499504
* @return \Magento\Framework\EntityManager\EntityMetadata
500505
*/
501506
private function getCategoryMetadata()
@@ -509,6 +514,8 @@ private function getCategoryMetadata()
509514
}
510515

511516
/**
517+
* Get skip static columns instance.
518+
*
512519
* @return array
513520
*/
514521
private function getSkipStaticColumns()

app/code/Magento/Catalog/Model/ResourceModel/Product/LinkedProductSelectBuilderByBasePrice.php

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,9 @@
1111
use Magento\Framework\DB\Select;
1212
use Magento\Store\Model\Store;
1313

14+
/**
15+
* Provide Select object for retrieve product id with minimal price.
16+
*/
1417
class LinkedProductSelectBuilderByBasePrice implements LinkedProductSelectBuilderInterface
1518
{
1619
/**
@@ -69,7 +72,7 @@ public function __construct(
6972
}
7073

7174
/**
72-
* {@inheritdoc}
75+
* @inheritdoc
7376
*/
7477
public function build($productId)
7578
{
@@ -85,7 +88,7 @@ public function build($productId)
8588
[]
8689
)->joinInner(
8790
[BaseSelectProcessorInterface::PRODUCT_TABLE_ALIAS => $productTable],
88-
sprintf('%s.entity_id = link.child_id', BaseSelectProcessorInterface::PRODUCT_TABLE_ALIAS, $linkField),
91+
sprintf('%s.entity_id = link.child_id', BaseSelectProcessorInterface::PRODUCT_TABLE_ALIAS),
8992
['entity_id']
9093
)->joinInner(
9194
['t' => $priceAttribute->getBackendTable()],

0 commit comments

Comments
 (0)