for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace Kerox\Messenger\Message\Attachment\Template\Receipt;
class Summary implements \JsonSerializable
{
/**
* @var float
*/
protected $subtotal;
protected $shippingCost;
protected $totalTax;
protected $totalCost;
* Summary constructor.
*
* @param float $totalCost
public function __construct(float $totalCost)
$this->totalCost = $totalCost;
}
* @param float $subtotal
* @return Summary
public function setSubtotal(float $subtotal): Summary
$this->subtotal = $subtotal;
return $this;
* @param float $shippingCost
public function setShippingCost(float $shippingCost): Summary
$this->shippingCost = $shippingCost;
* @param float $totalTax
public function setTotalTax(float $totalTax): Summary
$this->totalTax = $totalTax;
* @return array
public function jsonSerialize(): array
$json = [
'subtotal' => $this->subtotal,
'shipping_cost' => $this->shippingCost,
'total_tax' => $this->totalTax,
'total_cost' => $this->totalCost,
];
return array_filter($json);