Skip to content

Commit cd5f68a

Browse files
committed
Merge remote-tracking branch 'anzin/php8-compatibility/fix-critical-error-in-functional-test' into platform-health
2 parents 9a02ceb + 9ba3d0a commit cd5f68a

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

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

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,7 @@ public function __construct(
8282
* @param int $bundleId
8383
* @param int|null $websiteId
8484
* @return array
85+
* @SuppressWarnings(PHPMD.CyclomaticComplexity)
8586
*/
8687
public function getChildProductIds(int $bundleId, ?int $websiteId = null): array
8788
{
@@ -128,10 +129,12 @@ public function getChildProductIds(int $bundleId, ?int $websiteId = null): array
128129
private function getProducts(array $selectionProductIds, int $websiteId): array
129130
{
130131
$productIds = [];
131-
$defaultStoreId = $this->storeManager->getWebsite($websiteId)->getDefaultStore()->getId();
132+
$defaultStore = $this->storeManager->getWebsite($websiteId)->getDefaultStore();
133+
$defaultStoreId = $defaultStore ? $defaultStore->getId() : null;
132134
foreach ($selectionProductIds as $optionProductIds) {
133-
$productIds = array_merge($productIds, $optionProductIds);
135+
$productIds[] = $optionProductIds;
134136
}
137+
$productIds = array_merge([], ...$productIds);
135138
$productCollection = $this->productCollectionFactory->create();
136139
$productCollection->joinAttribute(
137140
ProductInterface::STATUS,

lib/internal/Magento/Framework/Filesystem/Driver/Http.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -246,11 +246,11 @@ protected function getScheme($scheme = null)
246246
* @param string $hostname
247247
* @param int $port
248248
* @throws \Magento\Framework\Exception\FileSystemException
249-
* @return array
249+
* @return resource|bool
250250
*/
251251
protected function open($hostname, $port)
252252
{
253-
$result = @fsockopen($hostname, $port, $errorNumber = null, $errorMessage = null);
253+
$result = @fsockopen($hostname, $port, $errorNumber, $errorMessage);
254254
if ($result === false) {
255255
throw new FileSystemException(
256256
new \Magento\Framework\Phrase(

0 commit comments

Comments
 (0)