Skip to content

Commit e20cd4b

Browse files
authored
ENGCOM-9330: Int|null variables must be integer or null #34140
2 parents 355a064 + 2be0f84 commit e20cd4b

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

app/code/Magento/Catalog/Model/ProductRepository.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@
3636
/**
3737
* @inheritdoc
3838
*
39+
* @SuppressWarnings(PHPMD.ExcessiveClassComplexity)
3940
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
4041
* @SuppressWarnings(PHPMD.TooManyFields)
4142
*/
@@ -280,7 +281,7 @@ public function __construct(
280281
*/
281282
public function get($sku, $editMode = false, $storeId = null, $forceReload = false)
282283
{
283-
$cacheKey = $this->getCacheKey([$editMode, $storeId]);
284+
$cacheKey = $this->getCacheKey([$editMode, $storeId === null ? $storeId : (int) $storeId]);
284285
$cachedProduct = $this->getProductFromLocalCache($sku, $cacheKey);
285286
if ($cachedProduct === null || $forceReload) {
286287
$product = $this->productFactory->create();
@@ -295,7 +296,7 @@ public function get($sku, $editMode = false, $storeId = null, $forceReload = fal
295296
$product->setData('_edit_mode', true);
296297
}
297298
if ($storeId !== null) {
298-
$product->setData('store_id', $storeId);
299+
$product->setData('store_id', (int) $storeId);
299300
}
300301
$product->load($productId);
301302
$this->cacheProduct($cacheKey, $product);
@@ -522,6 +523,7 @@ protected function processMediaGallery(ProductInterface $product, $mediaGalleryE
522523
* @inheritdoc
523524
* @SuppressWarnings(PHPMD.CyclomaticComplexity)
524525
* @SuppressWarnings(PHPMD.NPathComplexity)
526+
* @SuppressWarnings(PHPMD.ExcessiveMethodLength)
525527
*/
526528
public function save(ProductInterface $product, $saveOptions = false)
527529
{

0 commit comments

Comments
 (0)