File tree Expand file tree Collapse file tree 2 files changed +6
-5
lines changed
app/code/Magento/Paypal/Model Expand file tree Collapse file tree 2 files changed +6
-5
lines changed Original file line number Diff line number Diff line change @@ -1519,11 +1519,10 @@ protected function _applyStreetAndRegionWorkarounds(DataObject $address)
1519
1519
)->setPageSize (
1520
1520
1
1521
1521
);
1522
- foreach ($ regions as $ region ) {
1523
- $ address ->setRegionId ($ region ->getId ());
1524
- $ address ->setExportedKeys (array_merge ($ address ->getExportedKeys (), ['region_id ' ]));
1525
- break ;
1526
- }
1522
+ $ regionItems = $ regions ->getItems ();
1523
+ $ region = array_shift ($ regionItems );
1524
+ $ address ->setRegionId ($ region ->getId ());
1525
+ $ address ->setExportedKeys (array_merge ($ address ->getExportedKeys (), ['region_id ' ]));
1527
1526
}
1528
1527
}
1529
1528
Original file line number Diff line number Diff line change @@ -357,12 +357,14 @@ public function __construct(
357
357
if (isset ($ params ['config ' ]) && $ params ['config ' ] instanceof PaypalConfig) {
358
358
$ this ->_config = $ params ['config ' ];
359
359
} else {
360
+ // phpcs:ignore Magento2.Exceptions.DirectThrow
360
361
throw new \Exception ('Config instance is required. ' );
361
362
}
362
363
363
364
if (isset ($ params ['quote ' ]) && $ params ['quote ' ] instanceof \Magento \Quote \Model \Quote) {
364
365
$ this ->_quote = $ params ['quote ' ];
365
366
} else {
367
+ // phpcs:ignore Magento2.Exceptions.DirectThrow
366
368
throw new \Exception ('Quote instance is required. ' );
367
369
}
368
370
}
You can’t perform that action at this time.
0 commit comments