Skip to content

Commit 143c00b

Browse files
committed
CR improvements
1 parent 8ce2d14 commit 143c00b

File tree

2 files changed

+7
-9
lines changed

2 files changed

+7
-9
lines changed

app/code/Magento/Customer/Model/Options.php

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -47,11 +47,10 @@ public function __construct(
4747
*/
4848
public function getNamePrefixOptions($store = null)
4949
{
50-
$options = $this->addressHelper->getConfig('prefix_options', $store);
51-
return $options !== null ? $this->prepareNamePrefixSuffixOptions(
52-
$options,
50+
return $this->prepareNamePrefixSuffixOptions(
51+
$this->addressHelper->getConfig('prefix_options', $store),
5352
$this->addressHelper->getConfig('prefix_show', $store) === NooptreqSource::VALUE_OPTIONAL
54-
) : false;
53+
);
5554
}
5655

5756
/**
@@ -95,13 +94,12 @@ protected function _prepareNamePrefixSuffixOptions($options, $isOptional = false
9594
*/
9695
private function prepareNamePrefixSuffixOptions($options, $isOptional = false)
9796
{
98-
$options = trim($options);
99-
if (empty($options)) {
97+
if ($options === null || empty(trim($options))) {
10098
return false;
10199
}
102-
103100
$result = [];
104-
$options = explode(';', $options);
101+
$options = explode(';', trim($options));
102+
105103
foreach ($options as $value) {
106104
$result[] = $this->escaper->escapeHtml(trim($value)) ?: ' ';
107105
}

app/code/Magento/Dhl/Model/Carrier.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -940,7 +940,7 @@ protected function _getDimension($dimension, $configWeightUnit = false)
940940
);
941941
}
942942

943-
return $dimension ? round($dimension, 3) : 0.0;
943+
return round((float) $dimension, 3);
944944
}
945945

946946
/**

0 commit comments

Comments
 (0)