for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace PHPSC\PagSeguro\Items;
use JMS\Serializer\Annotation as Serializer;
use PHPSC\PagSeguro\SerializerTrait;
/**
* @Serializer\AccessType("public_method")
* @Serializer\ReadOnly
* @Serializer\XmlRoot("item")
*
* @author Luís Otávio Cobucci Oblonczyk <[email protected]>
*/
class Item
{
use SerializerTrait;
* @Serializer\XmlElement(cdata=false)
* @var string
private $id;
private $description;
* @var float
private $amount;
* @Serializer\Type("integer")
* @var int
private $quantity;
private $shippingCost;
private $weight;
* @param string $id
* @param string $description
* @param float $amount
* @param int $quantity
* @param float $shippingCost
* @param int $weight
public function __construct(
$id,
$description,
$amount,
$quantity = 1,
$shippingCost = null,
$weight = null
) {
$this->id = $id;
$this->description = $description;
$this->amount = $amount;
$this->quantity = $quantity;
$this->shippingCost = $shippingCost;
$this->weight = $weight;
}
* @return string
public function getId()
return $this->id;
public function getDescription()
return $this->description;
public function getAmount()
return $this->formatAmount($this->amount);
* @return number
public function getQuantity()
return $this->quantity;
public function getShippingCost()
return $this->formatAmount($this->shippingCost);
public function getWeight()
return $this->weight;