Skip to content

Commit

Permalink
Merge pull request #24 from scufa/dimensions
Browse files Browse the repository at this point in the history
Dimensions are not required in Rate API
  • Loading branch information
gabrielbull committed Apr 22, 2015
2 parents a8c8df5 + b29bc7a commit 0943f31
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/Ups/Entity/Package.php
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ class Package implements NodeInterface
private $largePackage;

/**
* @var Dimensions
* @var Dimensions|null
*/
private $dimensions;

Expand All @@ -89,7 +89,6 @@ public function __construct($attributes = null)
{
$this->setPackagingType(new PackagingType);
$this->setReferenceNumber(new ReferenceNumber);
$this->setDimensions(new Dimensions);
$this->setPackageWeight(new PackageWeight);
$this->setPackageServiceOptions(new PackageServiceOptions);

Expand Down Expand Up @@ -146,7 +145,9 @@ public function toNode(DOMDocument $document = null)

$node->appendChild($this->getPackagingType()->toNode($document));
$node->appendChild($this->getPackageWeight()->toNode($document));
$node->appendChild($this->getDimensions()->toNode($document));
if (null !== $this->getDimensions()) {
$node->appendChild($this->getDimensions()->toNode($document));
}
$node->appendChild($this->getPackageServiceOptions()->toNode($document));
return $node;
}
Expand Down Expand Up @@ -190,7 +191,7 @@ public function setDescription($description)
}

/**
* @return Dimensions
* @return Dimensions|null
*/
public function getDimensions()
{
Expand Down

0 comments on commit 0943f31

Please sign in to comment.