Skip to content

Commit edd9d4c

Browse files
Make code more strict
1 parent f04154e commit edd9d4c

File tree

2 files changed

+7
-8
lines changed

2 files changed

+7
-8
lines changed

app/code/Magento/Bundle/Model/Plugin/Frontend/Product.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
* Copyright © Magento, Inc. All rights reserved.
44
* See COPYING.txt for license details.
55
*/
6+
declare(strict_types=1);
7+
68
namespace Magento\Bundle\Model\Plugin\Frontend;
79

810
use Magento\Bundle\Model\Product\Type;
@@ -28,13 +30,11 @@ public function __construct(Type $type)
2830
*
2931
* @param CatalogProduct $product
3032
* @param array $identities
31-
* @return string[]
33+
* @return array
3234
*/
33-
public function afterGetIdentities(
34-
CatalogProduct $product,
35-
array $identities
36-
) {
37-
foreach ($this->type->getChildrenIds($product->getEntityId()) as $optionId => $childIds) {
35+
public function afterGetIdentities(CatalogProduct $product, array $identities): array
36+
{
37+
foreach ($this->type->getChildrenIds($product->getEntityId()) as $childIds) {
3838
foreach ($childIds as $childId) {
3939
$identities[] = CatalogProduct::CACHE_TAG . '_' . $childId;
4040
}

app/code/Magento/ConfigurableProduct/Model/Plugin/Frontend/ProductIdentitiesExtender.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,11 +42,10 @@ public function __construct(Configurable $configurableType, ProductRepositoryInt
4242
* @param Product $subject
4343
* @param array $identities
4444
* @return array
45-
* @SuppressWarnings(PHPMD.UnusedFormalParameter)
4645
*/
4746
public function afterGetIdentities(Product $subject, array $identities): array
4847
{
49-
foreach ($this->configurableType->getChildrenIds($subject->getId()) as $key => $childIds) {
48+
foreach ($this->configurableType->getChildrenIds($subject->getId()) as $childIds) {
5049
foreach ($childIds as $childId) {
5150
$identities[] = Product::CACHE_TAG . '_' . $childId;
5251
}

0 commit comments

Comments
 (0)