Skip to content

Commit 1ece084

Browse files
committed
CE#34653: Added fixes after code review
1 parent 08ad450 commit 1ece084

File tree

2 files changed

+7
-9
lines changed

2 files changed

+7
-9
lines changed

app/code/Magento/CatalogSearch/Model/Indexer/Fulltext/Action/DataProvider.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -569,7 +569,7 @@ private function getAttributeValue($attributeId, $valueIds, $storeId)
569569
if (false !== $value) {
570570
$optionValue = $this->getAttributeOptionValue($attributeId, $valueIds, $storeId);
571571
if (null === $optionValue) {
572-
$value = $value !== null ? $this->filterAttributeValue($value) : '';
572+
$value = $this->filterAttributeValue($value);
573573
} else {
574574
$value = implode($this->separator, array_filter([$value, $optionValue]));
575575
}
@@ -605,7 +605,7 @@ private function getAttributeOptionValue($attributeId, $valueIds, $storeId)
605605
$this->attributeOptions[$optionKey] = array_column($options, 'label', 'value');
606606
$this->attributeOptions[$optionKey] = array_map(
607607
function ($value) {
608-
return $value !== null ? $this->filterAttributeValue($value) : '';
608+
return $this->filterAttributeValue($value);
609609
},
610610
$this->attributeOptions[$optionKey]
611611
);
@@ -625,11 +625,11 @@ function ($value) {
625625
/**
626626
* Remove whitespaces and tags from attribute value
627627
*
628-
* @param string $value
628+
* @param string|null $value
629629
* @return string
630630
*/
631-
private function filterAttributeValue(string $value)
631+
private function filterAttributeValue(?string $value)
632632
{
633-
return preg_replace('/\s+/iu', ' ', trim(strip_tags($value)));
633+
return $value !== null ? preg_replace('/\s+/iu', ' ', trim(strip_tags($value))) : '';
634634
}
635635
}

app/code/Magento/Quote/Model/Quote/Address.php

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1452,10 +1452,8 @@ public function setCountryId($countryId)
14521452
*/
14531453
public function getStreet()
14541454
{
1455-
$street = $this->getData(self::KEY_STREET);
1456-
if ($street === null) {
1457-
return [''];
1458-
}
1455+
$street = $this->getData(self::KEY_STREET) ?? [''];
1456+
14591457
return is_array($street) ? $street : explode("\n", $street);
14601458
}
14611459

0 commit comments

Comments
 (0)