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)
15191519 )->setPageSize (
15201520 1
15211521 );
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 ' ]));
15271526 }
15281527 }
15291528
Original file line number Diff line number Diff line change @@ -357,12 +357,14 @@ public function __construct(
357357 if (isset ($ params ['config ' ]) && $ params ['config ' ] instanceof PaypalConfig) {
358358 $ this ->_config = $ params ['config ' ];
359359 } else {
360+ // phpcs:ignore Magento2.Exceptions.DirectThrow
360361 throw new \Exception ('Config instance is required. ' );
361362 }
362363
363364 if (isset ($ params ['quote ' ]) && $ params ['quote ' ] instanceof \Magento \Quote \Model \Quote) {
364365 $ this ->_quote = $ params ['quote ' ];
365366 } else {
367+ // phpcs:ignore Magento2.Exceptions.DirectThrow
366368 throw new \Exception ('Quote instance is required. ' );
367369 }
368370 }
You can’t perform that action at this time.
0 commit comments