Skip to content

Commit e5b3bb3

Browse files
authored
Update ListProduct.php
use `current()` method of ArrayIterator object instead of `current()` php function
1 parent 455ca54 commit e5b3bb3

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

app/code/Magento/Catalog/Block/Product/ListProduct.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -458,7 +458,7 @@ private function initializeProductCollection()
458458
// if the product is associated with any category
459459
if ($categories->count()) {
460460
// show products from this category
461-
$this->setCategoryId(current($categories->getIterator())->getId());
461+
$this->setCategoryId($categories->getIterator()->current()->getId());
462462
}
463463
}
464464

0 commit comments

Comments
 (0)