Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 13 additions & 12 deletions src/AddressValidation.php
Original file line number Diff line number Diff line change
Expand Up @@ -166,45 +166,46 @@ private function createRequest()
$request->appendChild($xml->createElement('RequestAction', 'XAV'));

if (null !== $this->requestOption) {
$request->appendChild($xml->createElement('RequestOption', $this->requestOption));
$request->appendChild($xml->createElement('RequestOption', ($this->requestOption) !== null ? htmlspecialchars($this->requestOption) : null));
}

if (null !== $this->maxSuggestion) {
$avRequest->appendChild($xml->createElement('MaximumListSize', $this->maxSuggestion));
$avRequest->appendChild($xml->createElement('MaximumListSize', ($this->maxSuggestion) !== null ? htmlspecialchars($this->maxSuggestion) : null));
}

if (null !== $this->address) {
$addressNode = $avRequest->appendChild($xml->createElement('AddressKeyFormat'));

if ($this->address->getAttentionName()) {
$addressNode->appendChild($xml->createElement('ConsigneeName', $this->address->getAttentionName()));
$addressNode->appendChild($xml->createElement('ConsigneeName', ($this->address->getAttentionName()) !== null ? htmlspecialchars($this->address->getAttentionName()) : null));
}
if ($this->address->getBuildingName()) {
$addressNode->appendChild($xml->createElement('BuildingName', $this->address->getBuildingName()));
$addressNode->appendChild($xml->createElement('BuildingName', ($this->address->getBuildingName()) !== null ? htmlspecialchars($this->address->getBuildingName()) : null));
}
if ($this->address->getAddressLine1()) {
$addressNode->appendChild($xml->createElement('AddressLine', $this->address->getAddressLine1()));
$addressNode->appendChild($xml->createElement('AddressLine', ($this->address->getAddressLine1()) !== null ? htmlspecialchars($this->address->getAddressLine1()) : null));
}
if ($this->address->getAddressLine2()) {
$addressNode->appendChild($xml->createElement('AddressLine', $this->address->getAddressLine2()));
$addressNode->appendChild($xml->createElement('AddressLine', ($this->address->getAddressLine2()) !== null ? htmlspecialchars($this->address->getAddressLine2()) : null));
}
if ($this->address->getAddressLine3()) {
$addressNode->appendChild($xml->createElement('AddressLine', $this->address->getAddressLine3()));
$addressNode->appendChild($xml->createElement('AddressLine', ($this->address->getAddressLine3()) !== null ? htmlspecialchars($this->address->getAddressLine3()) : null));
}
if ($this->address->getStateProvinceCode()) {
$addressNode->appendChild($xml->createElement(
'PoliticalDivision1',
$this->address->getStateProvinceCode()
));
($this->address->getStateProvinceCode()
) !== null ? htmlspecialchars($this->address->getStateProvinceCode()
) : null));
}
if ($this->address->getCity()) {
$addressNode->appendChild($xml->createElement('PoliticalDivision2', $this->address->getCity()));
$addressNode->appendChild($xml->createElement('PoliticalDivision2', ($this->address->getCity()) !== null ? htmlspecialchars($this->address->getCity()) : null));
}
if ($this->address->getCountryCode()) {
$addressNode->appendChild($xml->createElement('CountryCode', $this->address->getCountryCode()));
$addressNode->appendChild($xml->createElement('CountryCode', ($this->address->getCountryCode()) !== null ? htmlspecialchars($this->address->getCountryCode()) : null));
}
if ($this->address->getPostalCode()) {
$addressNode->appendChild($xml->createElement('PostcodePrimaryLow', $this->address->getPostalCode()));
$addressNode->appendChild($xml->createElement('PostcodePrimaryLow', ($this->address->getPostalCode()) !== null ? htmlspecialchars($this->address->getPostalCode()) : null));
}
}

Expand Down
4 changes: 2 additions & 2 deletions src/Entity/AccessPointCOD.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,8 @@ public function toNode(DOMDocument $document = null)

$node = $document->createElement('AccessPointCOD');

$node->appendChild($document->createElement('CurrencyCode', $this->getCurrencyCode()));
$node->appendChild($document->createElement('MonetaryValue', $this->getMonetaryValue()));
$node->appendChild($document->createElement('CurrencyCode', ($this->getCurrencyCode()) !== null ? htmlspecialchars($this->getCurrencyCode()) : null));
$node->appendChild($document->createElement('MonetaryValue', ($this->getMonetaryValue()) !== null ? htmlspecialchars($this->getMonetaryValue()) : null));

return $node;
}
Expand Down
6 changes: 3 additions & 3 deletions src/Entity/AccessPointSearch.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,15 +43,15 @@ public function toNode(DOMDocument $document = null)
$node = $document->createElement('AccessPointSearch');

if ($this->getAccessPointStatus()) {
$node->appendChild($document->createElement('AccessPointStatus', $this->getAccessPointStatus()));
$node->appendChild($document->createElement('AccessPointStatus', ($this->getAccessPointStatus()) !== null ? htmlspecialchars($this->getAccessPointStatus()) : null));
}

if ($this->getPublicAccessPointId()) {
$node->appendChild($document->createElement('PublicAccessPointID', $this->getPublicAccessPointId()));
$node->appendChild($document->createElement('PublicAccessPointID', ($this->getPublicAccessPointId()) !== null ? htmlspecialchars($this->getPublicAccessPointId()) : null));
}

if ($this->getAccountNumber()) {
$node->appendChild($document->createElement('AccountNumber', $this->getAccountNumber()));
$node->appendChild($document->createElement('AccountNumber', ($this->getAccountNumber()) !== null ? htmlspecialchars($this->getAccountNumber()) : null));
}

return $node;
Expand Down
14 changes: 7 additions & 7 deletions src/Entity/Address.php
Original file line number Diff line number Diff line change
Expand Up @@ -267,26 +267,26 @@ public function toNode(DOMDocument $document = null)

$node = $document->createElement('Address');
if ($this->getAddressLine1()) {
$node->appendChild($document->createElement('AddressLine1', $this->getAddressLine1()));
$node->appendChild($document->createElement('AddressLine1', ($this->getAddressLine1()) !== null ? htmlspecialchars($this->getAddressLine1()) : null));
}

if ($this->getAddressLine2()) {
$node->appendChild($document->createElement('AddressLine2', $this->getAddressLine2()));
$node->appendChild($document->createElement('AddressLine2', ($this->getAddressLine2()) !== null ? htmlspecialchars($this->getAddressLine2()) : null));
}
if ($this->getAddressLine3()) {
$node->appendChild($document->createElement('AddressLine3', $this->getAddressLine3()));
$node->appendChild($document->createElement('AddressLine3', ($this->getAddressLine3()) !== null ? htmlspecialchars($this->getAddressLine3()) : null));
}
if ($this->getCity()) {
$node->appendChild($document->createElement('City', $this->getCity()));
$node->appendChild($document->createElement('City', ($this->getCity()) !== null ? htmlspecialchars($this->getCity()) : null));
}
if ($this->getStateProvinceCode()) {
$node->appendChild($document->createElement('StateProvinceCode', $this->getStateProvinceCode()));
$node->appendChild($document->createElement('StateProvinceCode', ($this->getStateProvinceCode()) !== null ? htmlspecialchars($this->getStateProvinceCode()) : null));
}
if ($this->getPostalCode()) {
$node->appendChild($document->createElement('PostalCode', $this->getPostalCode()));
$node->appendChild($document->createElement('PostalCode', ($this->getPostalCode()) !== null ? htmlspecialchars($this->getPostalCode()) : null));
}
if ($this->getCountryCode()) {
$node->appendChild($document->createElement('CountryCode', $this->getCountryCode()));
$node->appendChild($document->createElement('CountryCode', ($this->getCountryCode()) !== null ? htmlspecialchars($this->getCountryCode()) : null));
}
if ($this->getResidentialAddressIndicator()) {
$node->appendChild($document->createElement('ResidentialAddressIndicator'));
Expand Down
10 changes: 5 additions & 5 deletions src/Entity/AddressArtifactFormat.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,21 +42,21 @@ public function toNode(DOMDocument $document = null)
for ($i = 1; $i <= 3; $i++) {
$line = $this->{'getPoliticalDivision'.$i}();
if ($line) {
$node->appendChild($document->createElement('PoliticalDivision'.$i, $line));
$node->appendChild($document->createElement('PoliticalDivision'.$i, ($line) !== null ? htmlspecialchars($line) : null));
}
}

if ($this->getCountryCode()) {
$node->appendChild($document->createElement('CountryCode', $this->getCountryCode()));
$node->appendChild($document->createElement('CountryCode', ($this->getCountryCode()) !== null ? htmlspecialchars($this->getCountryCode()) : null));
}
if ($this->getCountry()) {
$node->appendChild($document->createElement('Country', $this->getCountry()));
$node->appendChild($document->createElement('Country', ($this->getCountry()) !== null ? htmlspecialchars($this->getCountry()) : null));
}
if ($this->getPostcodePrimaryHigh()) {
$node->appendChild($document->createElement('PostcodePrimaryHigh', $this->getPostcodePrimaryHigh()));
$node->appendChild($document->createElement('PostcodePrimaryHigh', ($this->getPostcodePrimaryHigh()) !== null ? htmlspecialchars($this->getPostcodePrimaryHigh()) : null));
}
if ($this->getPostcodePrimaryLow()) {
$node->appendChild($document->createElement('PostcodePrimaryLow', $this->getPostcodePrimaryLow()));
$node->appendChild($document->createElement('PostcodePrimaryLow', ($this->getPostcodePrimaryLow()) !== null ? htmlspecialchars($this->getPostcodePrimaryLow()) : null));
}

return $node;
Expand Down
12 changes: 6 additions & 6 deletions src/Entity/AddressKeyFormat.php
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ public function toNode(DOMDocument $document = null)
$node = $document->createElement('AddressKeyFormat');

if ($this->getConsigneeName()) {
$node->appendChild($document->createElement('ConsigneeName', $this->getConsigneeName()));
$node->appendChild($document->createElement('ConsigneeName', ($this->getConsigneeName()) !== null ? htmlspecialchars($this->getConsigneeName()) : null));
}

for ($i = 1; $i <= 3; $i++) {
Expand All @@ -69,23 +69,23 @@ public function toNode(DOMDocument $document = null)
for ($i = 1; $i <= 3; $i++) {
$line = $this->{'getPoliticalDivision'.$i}();
if ($line) {
$node->appendChild($document->createElement('PoliticalDivision'.$i, $line));
$node->appendChild($document->createElement('PoliticalDivision'.$i, ($line) !== null ? htmlspecialchars($line) : null));
}
}

if ($this->getPostcodePrimaryLow()) {
$node->appendChild($document->createElement('PostcodePrimaryLow', $this->getPostcodePrimaryLow()));
$node->appendChild($document->createElement('PostcodePrimaryLow', ($this->getPostcodePrimaryLow()) !== null ? htmlspecialchars($this->getPostcodePrimaryLow()) : null));
}
if ($this->getPostcodeExtendedLow()) {
$node->appendChild($document->createElement('PostcodeExtendedLow', $this->getPostcodeExtendedLow()));
$node->appendChild($document->createElement('PostcodeExtendedLow', ($this->getPostcodeExtendedLow()) !== null ? htmlspecialchars($this->getPostcodeExtendedLow()) : null));
}

if ($this->getCountryCode()) {
$node->appendChild($document->createElement('CountryCode', $this->getCountryCode()));
$node->appendChild($document->createElement('CountryCode', ($this->getCountryCode()) !== null ? htmlspecialchars($this->getCountryCode()) : null));
}

if ($this->getSingleLineAddress()) {
$node->appendChild($document->createElement('SingleLineAddress', $this->getSingleLineAddress()));
$node->appendChild($document->createElement('SingleLineAddress', ($this->getSingleLineAddress()) !== null ? htmlspecialchars($this->getSingleLineAddress()) : null));
}

return $node;
Expand Down
4 changes: 2 additions & 2 deletions src/Entity/AlternateDeliveryAddress.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,11 @@ public function toNode(DOMDocument $document = null)
$node = $document->createElement('AlternateDeliveryAddress');

if ($this->getName()) {
$node->appendChild($document->createElement('Name', $this->getName()));
$node->appendChild($document->createElement('Name', ($this->getName()) !== null ? htmlspecialchars($this->getName()) : null));
}

if ($this->getUpsAccessPointId()) {
$node->appendChild($document->createElement('UPSAccessPointID', $this->getUpsAccessPointId()));
$node->appendChild($document->createElement('UPSAccessPointID', ($this->getUpsAccessPointId()) !== null ? htmlspecialchars($this->getUpsAccessPointId()) : null));
}

$address = $this->getAddress();
Expand Down
4 changes: 2 additions & 2 deletions src/Entity/COD.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,11 +57,11 @@ public function toNode(DOMDocument $document = null)
$node = $document->createElement('COD');

if ($this->getCODCode()) {
$node->appendChild($document->createElement('CODCode', $this->getCODCode()));
$node->appendChild($document->createElement('CODCode', ($this->getCODCode()) !== null ? htmlspecialchars($this->getCODCode()) : null));
}

if ($this->getCODFundsCode()) {
$node->appendChild($document->createElement('CODFundsCode', $this->getCODFundsCode()));
$node->appendChild($document->createElement('CODFundsCode', ($this->getCODFundsCode()) !== null ? htmlspecialchars($this->getCODFundsCode()) : null));
}

if ($this->getCODAmount()) {
Expand Down
4 changes: 2 additions & 2 deletions src/Entity/CODAmount.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,10 @@ public function toNode(DOMDocument $document = null)
}
$node = $document->createElement('CODAmount');
if ($this->CurrencyCode) {
$node->appendChild($document->createElement('CurrencyCode', $this->CurrencyCode));
$node->appendChild($document->createElement('CurrencyCode', ($this->CurrencyCode) !== null ? htmlspecialchars($this->CurrencyCode) : null));
}
if ($this->MonetaryValue) {
$node->appendChild($document->createElement('MonetaryValue', $this->MonetaryValue));
$node->appendChild($document->createElement('MonetaryValue', ($this->MonetaryValue) !== null ? htmlspecialchars($this->MonetaryValue) : null));
}
return $node;
}
Expand Down
2 changes: 1 addition & 1 deletion src/Entity/CustomerClassification.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public function toNode(DOMDocument $document = null)
}

$node = $document->createElement('CustomerClassification');
$node->appendChild($document->createElement('Code', $this->getCode()));
$node->appendChild($document->createElement('Code', ($this->getCode()) !== null ? htmlspecialchars($this->getCode()) : null));

return $node;
}
Expand Down
2 changes: 1 addition & 1 deletion src/Entity/DeliveryConfirmation.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public function toNode(DOMDocument $document = null)

$node = $document->createElement('DeliveryConfirmation');

$node->appendChild($document->createElement('DCISType', $this->getDcisType()));
$node->appendChild($document->createElement('DCISType', ($this->getDcisType()) !== null ? htmlspecialchars($this->getDcisType()) : null));

return $node;
}
Expand Down
2 changes: 1 addition & 1 deletion src/Entity/DeliveryTimeInformation.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public function toNode(DOMDocument $document = null)
}

$node = $document->createElement('DeliveryTimeInformation');
$node->appendChild($document->createElement('PackageBillType', $this->getPackageBillType()));
$node->appendChild($document->createElement('PackageBillType', ($this->getPackageBillType()) !== null ? htmlspecialchars($this->getPackageBillType()) : null));

if ($this->getPickup() !== null) {
$node->appendChild($this->getPickup()->toNode($document));
Expand Down
6 changes: 3 additions & 3 deletions src/Entity/Dimensions.php
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,9 @@ public function toNode(DOMDocument $document = null)
}

$node = $document->createElement('Dimensions');
$node->appendChild($document->createElement('Length', $this->getLength()));
$node->appendChild($document->createElement('Height', $this->getHeight()));
$node->appendChild($document->createElement('Width', $this->getWidth()));
$node->appendChild($document->createElement('Length', ($this->getLength()) !== null ? htmlspecialchars($this->getLength()) : null));
$node->appendChild($document->createElement('Height', ($this->getHeight()) !== null ? htmlspecialchars($this->getHeight()) : null));
$node->appendChild($document->createElement('Width', ($this->getWidth()) !== null ? htmlspecialchars($this->getWidth()) : null));
$node->appendChild($this->getUnitOfMeasurement()->toNode($document));

return $node;
Expand Down
2 changes: 1 addition & 1 deletion src/Entity/Discount.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public function toNode(DOMDocument $document = null)
}

$node = $document->createElement('Discount');
$node->appendChild($document->createElement('MonetaryValue', $this->getMonetaryValue()));
$node->appendChild($document->createElement('MonetaryValue', ($this->getMonetaryValue()) !== null ? htmlspecialchars($this->getMonetaryValue()) : null));

return $node;
}
Expand Down
6 changes: 3 additions & 3 deletions src/Entity/EEIFilingOption.php
Original file line number Diff line number Diff line change
Expand Up @@ -75,17 +75,17 @@ public function toNode(DOMDocument $document = null)

$code = $this->getCode();
if (isset($code)) {
$node->appendChild($document->createElement('Code', $code));
$node->appendChild($document->createElement('Code', ($code) !== null ? htmlspecialchars($code) : null));
}

$emailAddress = $this->getEmailAddress();
if (isset($emailAddress)) {
$node->appendChild($document->createElement('EMailAdress', $emailAddress));
$node->appendChild($document->createElement('EMailAdress', ($emailAddress) !== null ? htmlspecialchars($emailAddress) : null));
}

$description = $this->getDescription();
if (isset($description)) {
$node->appendChild($document->createElement('Description', $description));
$node->appendChild($document->createElement('Description', ($description) !== null ? htmlspecialchars($description) : null));
}

$upsFiled = $this->getUPSFiled();
Expand Down
Loading