Skip to content

Commit 572fe3a

Browse files
MAGETWO-91599: Table Rates not working for Armed Forces states in Europe (AE)
- Fix static tests
1 parent c35090c commit 572fe3a

File tree

3 files changed

+42
-2
lines changed

3 files changed

+42
-2
lines changed

app/code/Magento/OfflineShipping/Model/ResourceModel/Carrier/Tablerate/CSV/RowParser.php

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@
99
use Magento\Framework\Phrase;
1010
use Magento\OfflineShipping\Model\ResourceModel\Carrier\Tablerate\LocationDirectory;
1111

12+
/**
13+
* Row parser.
14+
*/
1215
class RowParser
1316
{
1417
/**
@@ -26,6 +29,8 @@ public function __construct(LocationDirectory $locationDirectory)
2629
}
2730

2831
/**
32+
* Retrieve columns.
33+
*
2934
* @return array
3035
*/
3136
public function getColumns()
@@ -42,6 +47,8 @@ public function getColumns()
4247
}
4348

4449
/**
50+
* Parse provided row data.
51+
*
4552
* @param array $rowData
4653
* @param int $rowNumber
4754
* @param int $websiteId
@@ -93,6 +100,8 @@ public function parse(
93100
}
94101

95102
/**
103+
* Get country id from provided row data.
104+
*
96105
* @param array $rowData
97106
* @param int $rowNumber
98107
* @param ColumnResolver $columnResolver
@@ -121,6 +130,8 @@ private function getCountryId(array $rowData, $rowNumber, ColumnResolver $column
121130
}
122131

123132
/**
133+
* Retrieve region id from provided row data.
134+
*
124135
* @param array $rowData
125136
* @param int $rowNumber
126137
* @param ColumnResolver $columnResolver
@@ -150,6 +161,8 @@ private function getRegionIds(array $rowData, $rowNumber, ColumnResolver $column
150161
}
151162

152163
/**
164+
* Retrieve zip code from provided row data.
165+
*
153166
* @param array $rowData
154167
* @param ColumnResolver $columnResolver
155168
* @return float|int|null|string
@@ -165,6 +178,8 @@ private function getZipCode(array $rowData, ColumnResolver $columnResolver)
165178
}
166179

167180
/**
181+
* Get condition value form provided row data.
182+
*
168183
* @param array $rowData
169184
* @param int $rowNumber
170185
* @param string $conditionFullName
@@ -192,6 +207,8 @@ private function getConditionValue(array $rowData, $rowNumber, $conditionFullNam
192207
}
193208

194209
/**
210+
* Retrieve price from provided row data.
211+
*
195212
* @param array $rowData
196213
* @param int $rowNumber
197214
* @param ColumnResolver $columnResolver
@@ -217,6 +234,7 @@ private function getPrice(array $rowData, $rowNumber, ColumnResolver $columnReso
217234

218235
/**
219236
* Parse and validate positive decimal value
237+
*
220238
* Return false if value is not decimal or is not positive
221239
*
222240
* @param string $value

app/code/Magento/OfflineShipping/Model/ResourceModel/Carrier/Tablerate/Import.php

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
use Magento\Store\Model\StoreManagerInterface;
1818

1919
/**
20+
* Import offline shipping.
2021
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
2122
*/
2223
class Import
@@ -87,6 +88,8 @@ public function __construct(
8788
}
8889

8990
/**
91+
* Check if there are errors.
92+
*
9093
* @return bool
9194
*/
9295
public function hasErrors()
@@ -95,6 +98,8 @@ public function hasErrors()
9598
}
9699

97100
/**
101+
* Get errors.
102+
*
98103
* @return array
99104
*/
100105
public function getErrors()
@@ -103,6 +108,8 @@ public function getErrors()
103108
}
104109

105110
/**
111+
* Retrieve columns.
112+
*
106113
* @return array
107114
*/
108115
public function getColumns()
@@ -111,6 +118,8 @@ public function getColumns()
111118
}
112119

113120
/**
121+
* Get data from file.
122+
*
114123
* @param ReadInterface $file
115124
* @param int $websiteId
116125
* @param string $conditionShortName
@@ -177,6 +186,8 @@ public function getData(ReadInterface $file, $websiteId, $conditionShortName, $c
177186
}
178187

179188
/**
189+
* Retrieve column headers.
190+
*
180191
* @param ReadInterface $file
181192
* @return array|bool
182193
* @throws LocalizedException

app/code/Magento/OfflineShipping/Model/ResourceModel/Carrier/Tablerate/LocationDirectory.php

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@
66

77
namespace Magento\OfflineShipping\Model\ResourceModel\Carrier\Tablerate;
88

9+
/**
10+
* Location directory.
11+
*/
912
class LocationDirectory
1013
{
1114
/**
@@ -52,6 +55,8 @@ public function __construct(
5255
}
5356

5457
/**
58+
* Retrieve country id.
59+
*
5560
* @param string $countryCode
5661
* @return null|string
5762
*/
@@ -93,6 +98,8 @@ protected function loadCountries()
9398
}
9499

95100
/**
101+
* Check if there is country id with provided country code.
102+
*
96103
* @param string $countryCode
97104
* @return bool
98105
*/
@@ -103,6 +110,8 @@ public function hasCountryId($countryCode)
103110
}
104111

105112
/**
113+
* Check if there is region id with provided region code and country id.
114+
*
106115
* @param string $countryId
107116
* @param string $regionCode
108117
* @return bool
@@ -141,6 +150,8 @@ protected function loadRegions()
141150
}
142151

143152
/**
153+
* Retrieve region id.
154+
*
144155
* @param int $countryId
145156
* @param string $regionCode
146157
* @return string
@@ -155,8 +166,8 @@ public function getRegionId($countryId, $regionCode)
155166
/**
156167
* Return region ids for country and region
157168
*
158-
* @param $countryId
159-
* @param $regionCode
169+
* @param int $countryId
170+
* @param string $regionCode
160171
* @return array
161172
*/
162173
public function getRegionIds($countryId, $regionCode)

0 commit comments

Comments
 (0)