Skip to content

Commit

Permalink
Fix mistakes (#325)
Browse files Browse the repository at this point in the history
  • Loading branch information
DeryabinSergey authored Jun 7, 2021
1 parent ddb3c86 commit d3e5040
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 5 deletions.
15 changes: 15 additions & 0 deletions src/Entity/AccessPointCOD.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,21 @@ class AccessPointCOD implements NodeInterface
*/
private $monetaryValue;

/**
* @param \stdClass|null $response
*/
public function __construct(\stdClass $response = null)
{
if (null !== $response) {
if (isset($response->CurrencyCode)) {
$this->setCurrencyCode($response->CurrencyCode);
}
if (isset($response->MonetaryValue)) {
$this->setMonetaryValue($response->MonetaryValue);
}
}
}

/**
* @param null|DOMDocument $document
*
Expand Down
2 changes: 1 addition & 1 deletion src/Entity/CODAmount.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ public function toNode(DOMDocument $document = null)
*/
public function getCurrencyCode()
{
return $this->CODCode;
return $this->CurrencyCode;
}

/**
Expand Down
2 changes: 1 addition & 1 deletion src/Entity/ItemizedPaymentInformation.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ public function setShipmentCharge(ShipmentCharge $shipmentCharge)
} elseif ($shipmentCharge->getType() === ShipmentCharge::SHIPMENT_CHARGE_TYPE_DUTIES) {
$this->dutiesAndTaxesShipmentCharge = $shipmentCharge;
} else {
throw new LogicException(sprintf('Unknown ShipmentCharge charge type requested: "%s"', $type));
throw new LogicException(sprintf('Unknown ShipmentCharge charge type requested: "%s"', $shipmentCharge->getType()));
}
return $this;
}
Expand Down
3 changes: 0 additions & 3 deletions src/Entity/ShipmentServiceOptions.php
Original file line number Diff line number Diff line change
Expand Up @@ -127,9 +127,6 @@ public function __construct($response = null)
if (isset($response->LabelMethod)) {
$this->setLabelMethod(new LabelMethod($response->LabelMethod));
}
if (isset($response->EMailMessage)) {
$this->setEMailMessage(new EMailMessage($response->EMailMessage));
}
}
}

Expand Down

0 comments on commit d3e5040

Please sign in to comment.