Fixed formatting to match PSR-2
This commit is contained in:
parent
2938be5a2d
commit
04cae3c295
@ -58,7 +58,6 @@ class Ship
|
|||||||
|
|
||||||
// Build approvedCodes
|
// Build approvedCodes
|
||||||
foreach ($this->shipping_options as $shipping_group => $row) {
|
foreach ($this->shipping_options as $shipping_group => $row) {
|
||||||
|
|
||||||
foreach ($row as $_carrier => $row2) {
|
foreach ($row as $_carrier => $row2) {
|
||||||
if (!isset($approvedCodes[$_carrier])) {
|
if (!isset($approvedCodes[$_carrier])) {
|
||||||
$approvedCodes[$_carrier] = [];
|
$approvedCodes[$_carrier] = [];
|
||||||
@ -89,9 +88,7 @@ class Ship
|
|||||||
$group_codes = array_keys($row2);
|
$group_codes = array_keys($row2);
|
||||||
|
|
||||||
if (! empty($rates[$carrier])) {
|
if (! empty($rates[$carrier])) {
|
||||||
|
|
||||||
foreach ($rates[$carrier] as $row3) {
|
foreach ($rates[$carrier] as $row3) {
|
||||||
|
|
||||||
if (in_array($row3->getCode(), $group_codes)) {
|
if (in_array($row3->getCode(), $group_codes)) {
|
||||||
$row3->setCarrier($carrier);
|
$row3->setCarrier($carrier);
|
||||||
|
|
||||||
@ -127,9 +124,7 @@ class Ship
|
|||||||
$group_codes = array_keys($row2);
|
$group_codes = array_keys($row2);
|
||||||
|
|
||||||
if (!empty($rates[$carrier])) {
|
if (!empty($rates[$carrier])) {
|
||||||
|
|
||||||
foreach ($rates[$carrier] as $row3) {
|
foreach ($rates[$carrier] as $row3) {
|
||||||
|
|
||||||
if (in_array($row3->getCode(), $group_codes)) {
|
if (in_array($row3->getCode(), $group_codes)) {
|
||||||
$row3->setCarrier($carrier);
|
$row3->setCarrier($carrier);
|
||||||
$display_rates[$shipping_group][] = $row3;
|
$display_rates[$shipping_group][] = $row3;
|
||||||
|
@ -89,7 +89,7 @@ class Rate extends RateAdapter
|
|||||||
$this->userId = Arr::get($options, 'userId');
|
$this->userId = Arr::get($options, 'userId');
|
||||||
$this->password = Arr::get($options, 'password');
|
$this->password = Arr::get($options, 'password');
|
||||||
$this->shipperNumber = Arr::get($options, 'shipperNumber');
|
$this->shipperNumber = Arr::get($options, 'shipperNumber');
|
||||||
$this->approvedCodes = Arr::get($options, 'approvedCodes',[
|
$this->approvedCodes = Arr::get($options, 'approvedCodes', [
|
||||||
'03',
|
'03',
|
||||||
'12',
|
'12',
|
||||||
]);
|
]);
|
||||||
|
@ -1,10 +1,12 @@
|
|||||||
<?php
|
<?php
|
||||||
namespace pdt256\Shipping;
|
namespace pdt256\Shipping;
|
||||||
|
|
||||||
class Validator {
|
class Validator
|
||||||
public static function checkIfNull($value, $name) {
|
{
|
||||||
if ($value === null) {
|
public static function checkIfNull($value, $name)
|
||||||
throw new \LogicException("$name is not set");
|
{
|
||||||
}
|
if ($value === null) {
|
||||||
}
|
throw new \LogicException("$name is not set");
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
Loading…
x
Reference in New Issue
Block a user