Skip to content

Commit 9ba3d0a

Browse files
committed
Fixed Static Test
1 parent 4a574a5 commit 9ba3d0a

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

app/code/Magento/Bundle/Model/Product/SelectionProductsDisabledRequired.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
use Magento\Framework\EntityManager\MetadataPool;
1111
use Magento\Catalog\Model\Product\Attribute\Source\Status;
1212
use Magento\Bundle\Model\ResourceModel\Selection as BundleSelection;
13-
use Magento\Store\Model\Store;
1413
use Magento\Store\Model\StoreManagerInterface;
1514
use Magento\Catalog\Model\ResourceModel\Product\CollectionFactory as ProductCollectionFactory;
1615
use Magento\Catalog\Model\Product;
@@ -83,6 +82,7 @@ public function __construct(
8382
* @param int $bundleId
8483
* @param int|null $websiteId
8584
* @return array
85+
* @SuppressWarnings(PHPMD.CyclomaticComplexity)
8686
*/
8787
public function getChildProductIds(int $bundleId, ?int $websiteId = null): array
8888
{
@@ -130,10 +130,11 @@ private function getProducts(array $selectionProductIds, int $websiteId): array
130130
{
131131
$productIds = [];
132132
$defaultStore = $this->storeManager->getWebsite($websiteId)->getDefaultStore();
133-
$defaultStoreId = $defaultStore ? $defaultStore->getId() : Store::DEFAULT_STORE_ID;
133+
$defaultStoreId = $defaultStore ? $defaultStore->getId() : null;
134134
foreach ($selectionProductIds as $optionProductIds) {
135-
$productIds = array_merge($productIds, $optionProductIds);
135+
$productIds[] = $optionProductIds;
136136
}
137+
$productIds = array_merge([], ...$productIds);
137138
$productCollection = $this->productCollectionFactory->create();
138139
$productCollection->joinAttribute(
139140
ProductInterface::STATUS,

0 commit comments

Comments
 (0)