vendor/shopware/core/Checkout/Cart/Tax/Struct/CalculatedTax.php line 8

Open in your IDE?
  1. <?php declare(strict_types=1);
  2. namespace Shopware\Core\Checkout\Cart\Tax\Struct;
  3. use Shopware\Core\Framework\Struct\Struct;
  4. use Shopware\Core\Framework\Util\FloatComparator;
  5. class CalculatedTax extends Struct
  6. {
  7.     /**
  8.      * @var float
  9.      */
  10.     protected $tax 0;
  11.     /**
  12.      * @var float
  13.      */
  14.     protected $taxRate;
  15.     /**
  16.      * @var float
  17.      */
  18.     protected $price 0;
  19.     public function __construct(float $taxfloat $taxRatefloat $price)
  20.     {
  21.         $this->tax FloatComparator::cast($tax);
  22.         $this->taxRate FloatComparator::cast($taxRate);
  23.         $this->price FloatComparator::cast($price);
  24.     }
  25.     public function getTax(): float
  26.     {
  27.         return $this->tax;
  28.     }
  29.     public function setTax(float $tax): void
  30.     {
  31.         $this->tax FloatComparator::cast($tax);
  32.     }
  33.     public function getTaxRate(): float
  34.     {
  35.         return $this->taxRate;
  36.     }
  37.     public function getPrice(): float
  38.     {
  39.         return $this->price;
  40.     }
  41.     public function increment(self $calculatedTax): void
  42.     {
  43.         $this->tax FloatComparator::cast($this->tax $calculatedTax->getTax());
  44.         $this->price FloatComparator::cast($this->price $calculatedTax->getPrice());
  45.     }
  46.     public function setPrice(float $price): void
  47.     {
  48.         $this->price FloatComparator::cast($price);
  49.     }
  50.     public function getApiAlias(): string
  51.     {
  52.         return 'cart_tax_calculated';
  53.     }
  54. }