Skip to content

Commit e31ea92

Browse files
#8810 - fixed php code style issue
1 parent b9e0abe commit e31ea92

File tree

1 file changed

+8
-9
lines changed

1 file changed

+8
-9
lines changed

app/code/Magento/Eav/Model/Entity/Attribute/OptionManagement.php

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -158,17 +158,16 @@ private function getOptionId($option)
158158
* @param string $optionLabel
159159
* @return void
160160
*/
161-
public function setOptionValue($option, $attribute, $optionLabel)
161+
protected function setOptionValue($option, $attribute, $optionLabel)
162162
{
163-
if ($optionId = $attribute->getSource()->getOptionId($optionLabel)) {
163+
$optionId = $attribute->getSource()->getOptionId($optionLabel);
164+
if ($optionId) {
164165
$option->setValue($attribute->getSource()->getOptionId($optionId));
165-
} else {
166-
if (is_array($option->getStoreLabels())) {
167-
foreach ($option->getStoreLabels() as $label) {
168-
if ($optionId = $attribute->getSource()->getOptionId($label->getLabel())) {
169-
$option->setValue($attribute->getSource()->getOptionId($optionId));
170-
break;
171-
}
166+
} elseif (is_array($option->getStoreLabels())) {
167+
foreach ($option->getStoreLabels() as $label) {
168+
if ($optionId = $attribute->getSource()->getOptionId($label->getLabel())) {
169+
$option->setValue($attribute->getSource()->getOptionId($optionId));
170+
break;
172171
}
173172
}
174173
}

0 commit comments

Comments
 (0)