Skip to content

Commit 6167400

Browse files
author
Ben Batschelet
committed
Fix additional calls to count() on null values
1 parent ced6573 commit 6167400

File tree

3 files changed

+9
-4
lines changed

3 files changed

+9
-4
lines changed

app/code/Magento/Theme/Block/Html/Topmenu.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ protected function _addSubMenu($child, $childLevel, $childrenWrapClass, $limit)
177177
return $html;
178178
}
179179

180-
$colStops = null;
180+
$colStops = [];
181181
if ($childLevel == 0 && $limit) {
182182
$colStops = $this->_columnBrake($child->getChildren(), $limit);
183183
}
@@ -205,7 +205,7 @@ protected function _getHtml(
205205
\Magento\Framework\Data\Tree\Node $menuTree,
206206
$childrenWrapClass,
207207
$limit,
208-
$colBrakes = []
208+
array $colBrakes = []
209209
) {
210210
$html = '';
211211

setup/src/Magento/Setup/Fixtures/ConfigurableProductsFixture.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -722,6 +722,8 @@ private function getSearchTerms()
722722
if ($searchTerms !== null) {
723723
$searchTerms = array_key_exists(0, $searchTerms['search_term'])
724724
? $searchTerms['search_term'] : [$searchTerms['search_term']];
725+
} else {
726+
$searchTerms = [];
725727
}
726728
return $searchTerms;
727729
}
@@ -845,7 +847,7 @@ private function getDescriptionClosure(
845847
$minAmountOfWordsDescription,
846848
$descriptionPrefix
847849
) {
848-
$count = $searchTerms === null
850+
$count = !$searchTerms
849851
? 0
850852
: round(
851853
$searchTerms[$index % count($searchTerms)]['count'] * (

setup/src/Magento/Setup/Model/FixtureGenerator/ProductGenerator.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,10 @@ public function generate($products, $fixtureMap)
170170
],
171171
],
172172
];
173-
if (count($fixtureMap['website_ids'](1, 0)) === 1) {
173+
if (
174+
!is_array($fixtureMap['website_ids'](1, 0)) ||
175+
count($fixtureMap['website_ids'](1, 0)) === 1
176+
) {
174177
// Get website id from fixture in case when one site is assigned per product
175178
$customTableMap['catalog_product_website'] = [
176179
'fields' => [

0 commit comments

Comments
 (0)