Skip to content

Commit 3bab714

Browse files
committed
Fix codacy unused variable in for, and improve condition
1 parent 2eeb633 commit 3bab714

File tree

1 file changed

+2
-2
lines changed
  • app/code/Magento/Catalog/Controller/Adminhtml/Product/Attribute

1 file changed

+2
-2
lines changed

app/code/Magento/Catalog/Controller/Adminhtml/Product/Attribute/Validate.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -110,8 +110,8 @@ public function execute()
110110
$options
111111
);
112112
$valueOptions = (isset($options['value']) && is_array($options['value'])) ? $options['value'] : [];
113-
foreach ($valueOptions as $key => $valueOption) {
114-
if (isset($options['delete'][$key]) && $options['delete'][$key]) {
113+
foreach (array_keys($valueOptions) as $key) {
114+
if (!empty($options['delete'][$key])) {
115115
unset($valueOptions[$key]);
116116
}
117117
}

0 commit comments

Comments
 (0)