Skip to content

Commit aceeea3

Browse files
committed
Fixed Failed static cases By removing the unwanted code
1 parent d7a45d5 commit aceeea3

File tree

3 files changed

+7
-16
lines changed

3 files changed

+7
-16
lines changed

app/code/Magento/Checkout/Model/Sidebar.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ protected function normalize($itemQty)
135135
}
136136

137137
$filter = new LocalizedToNormalized(
138-
['locale' => $this->resolver->getLocale(), 'type' => NumberFormatter::TYPE_DOUBLE]
138+
['locale' => $this->resolver->getLocale()]
139139
);
140140
return $filter->filter((string)$itemQty);
141141
}

lib/internal/Magento/Framework/Filter/LocalizedToNormalized.php

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,7 @@ class LocalizedToNormalized implements FilterInterface
2020
protected $_options = [
2121
'locale' => null,
2222
'date_format' => null,
23-
'precision' => null,
24-
'type' => null,
23+
'precision' => null
2524
];
2625

2726
/**
@@ -69,12 +68,8 @@ public function filter($value)
6968
{
7069
if (is_numeric($value)) {
7170
$numberParse = new NumberParse(
72-
$this->_options['locale'],
73-
empty($this->_options['type'])
74-
? NumberFormatter::TYPE_DOUBLE
75-
: $this->_options['type']
71+
$this->_options['locale']
7672
);
77-
7873
return (string)$numberParse->filter($value);
7974
} elseif ($this->_options['date_format'] === null && strpos($value, ':') !== false) {
8075
$formatter = new IntlDateFormatter(

lib/internal/Magento/Framework/Filter/Test/Unit/LocalizedToNormalizedTest.php

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,7 @@ public static function localizedToNormalizedDataProvider()
3939
[
4040
'locale' => 'nl',
4141
'date_format' => null,
42-
'precision' => null,
43-
'type' => NumberFormatter::TYPE_DOUBLE
42+
'precision' => null
4443
],
4544
"0.5"
4645
],
@@ -49,8 +48,7 @@ public static function localizedToNormalizedDataProvider()
4948
[
5049
'locale' => 'en',
5150
'date_format' => null,
52-
'precision' => null,
53-
'type' => ' '
51+
'precision' => null
5452
],
5553
"0.5"
5654
],
@@ -59,8 +57,7 @@ public static function localizedToNormalizedDataProvider()
5957
[
6058
'locale' => 'en',
6159
'date_format' => null,
62-
'precision' => null,
63-
'type' => ''
60+
'precision' => null
6461
],
6562
"2"
6663
],
@@ -69,8 +66,7 @@ public static function localizedToNormalizedDataProvider()
6966
[
7067
'locale' => 'en',
7168
'date_format' => 'Y-M-d',
72-
'precision' => null,
73-
'type' => ''
69+
'precision' => null
7470
],
7571
[
7672
"date_format" => "Y-M-d",

0 commit comments

Comments
 (0)