Skip to content

Commit 2b2858e

Browse files
author
Burlacu Vasilii
committed
Added adjustments as per review
1 parent 2619c78 commit 2b2858e

File tree

3 files changed

+11
-14
lines changed

3 files changed

+11
-14
lines changed

app/code/Magento/Catalog/Model/Config/LayerCategoryConfig.php

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -69,14 +69,12 @@ public function isCategoryFilterVisibleInLayerNavigation(
6969
/**
7070
* Get the current store ID
7171
*
72-
* @return int|null
72+
* @return int
73+
*
74+
* @throws NoSuchEntityException
7375
*/
74-
private function getStoreId(): ?int
76+
private function getStoreId(): int
7577
{
76-
try {
77-
return (int) $this->storeManager->getStore()->getId();
78-
} catch (NoSuchEntityException $e) {
79-
return null;
80-
}
78+
return (int) $this->storeManager->getStore()->getId();
8179
}
8280
}

app/code/Magento/Catalog/Model/Layer/FilterList.php

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -48,26 +48,25 @@ class FilterList
4848
protected $filters = [];
4949

5050
/**
51-
* @var LayerCategoryConfig|null
51+
* @var LayerCategoryConfig
5252
*/
5353
private $layerCategoryConfig;
5454

5555
/**
5656
* @param \Magento\Framework\ObjectManagerInterface $objectManager
5757
* @param FilterableAttributeListInterface $filterableAttributes
58+
* @param LayerCategoryConfig $layerCategoryConfig
5859
* @param array $filters
59-
* @param LayerCategoryConfig|null $layerCategoryConfig
6060
*/
6161
public function __construct(
6262
\Magento\Framework\ObjectManagerInterface $objectManager,
6363
FilterableAttributeListInterface $filterableAttributes,
64-
array $filters = [],
65-
LayerCategoryConfig $layerCategoryConfig = null
64+
LayerCategoryConfig $layerCategoryConfig,
65+
array $filters = []
6666
) {
6767
$this->objectManager = $objectManager;
6868
$this->filterableAttributes = $filterableAttributes;
69-
$this->layerCategoryConfig = $layerCategoryConfig ?:
70-
ObjectManager::getInstance()->get(LayerCategoryConfig::class);
69+
$this->layerCategoryConfig = $layerCategoryConfig;
7170

7271
/** Override default filter type models */
7372
$this->filterTypes = array_merge($this->filterTypes, $filters);

app/code/Magento/Catalog/etc/adminhtml/system.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@
140140
</group>
141141
<group id="layered_navigation">
142142
<field id="display_category" translate="label" type="select" sortOrder="15" showInDefault="1" showInWebsite="1" showInStore="1" canRestore="1">
143-
<label>Display Category</label>
143+
<label>Display Category Filter</label>
144144
<source_model>Magento\Config\Model\Config\Source\Yesno</source_model>
145145
</field>
146146
</group>

0 commit comments

Comments
 (0)