Skip to content

Commit b9419fb

Browse files
author
Allan Paiste
committed
change code formatting to okease automatic code-sniffer
1 parent 70d3468 commit b9419fb

File tree

3 files changed

+14
-11
lines changed

3 files changed

+14
-11
lines changed

app/code/Magento/Catalog/Controller/Adminhtml/Category/Save.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -233,10 +233,11 @@ public function execute()
233233
}
234234

235235
/**
236-
* @param $data
237-
* @return array
236+
* @param array $data Category data
237+
* @return mixed
238+
* @throws \Magento\Framework\Exception\LocalizedException
238239
*/
239-
public function imagePreprocessing($data)
240+
public function imagePreprocessing(array $data)
240241
{
241242
$entityType = $this->eavConfig->getEntityType(CategoryAttributeInterface::ENTITY_TYPE_CODE);
242243

app/code/Magento/Catalog/Model/Category/Attribute/Backend/Image.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,8 +64,8 @@ public function __construct(
6464
}
6565

6666
/**
67-
* @param $value
68-
* @return string|bool
67+
* @param array|bool|null $value Attribute value
68+
* @return bool
6969
*/
7070
protected function getUploadedImageName($value)
7171
{

app/code/Magento/Catalog/Model/Category/DataProvider.php

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -210,15 +210,17 @@ public function getData()
210210
foreach ($category->getAttributes() as $attributeCode => $attribute) {
211211
$backendModel = $attribute->getBackend();
212212

213+
if (!isset($categoryData[$attributeCode])) {
214+
continue;
215+
}
216+
213217
if ($backendModel instanceof \Magento\Catalog\Model\Category\Attribute\Backend\Image) {
214-
if (isset($categoryData[$attributeCode])) {
215-
unset($categoryData[$attributeCode]);
218+
unset($categoryData[$attributeCode]);
216219

217-
$categoryData[$attributeCode][0]['name'] = $category->getData($attributeCode);
218-
$categoryData[$attributeCode][0]['url'] = $category->getImageUrl($attributeCode);
219-
}
220+
$categoryData[$attributeCode][0]['name'] = $category->getData($attributeCode);
221+
$categoryData[$attributeCode][0]['url'] = $category->getImageUrl($attributeCode);
220222
}
221-
}
223+
}
222224

223225
$this->loadedData[$category->getId()] = $categoryData;
224226
}

0 commit comments

Comments
 (0)