This repository has been archived by the owner on Oct 27, 2024. It is now read-only.
forked from driesvints/vat-calculator
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Make the VatCalculator object immutable by returning VatPrice
- Loading branch information
Showing
7 changed files
with
165 additions
and
379 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
<?php | ||
declare(strict_types = 1); | ||
|
||
|
||
namespace Spaze\VatCalculator; | ||
|
||
|
||
class VatPrice | ||
{ | ||
|
||
/** @var float */ | ||
private $netPrice; | ||
|
||
/** @var float */ | ||
private $price; | ||
|
||
/** @var float */ | ||
private $taxValue; | ||
|
||
/** @var float */ | ||
private $taxRate; | ||
|
||
|
||
public function __construct(float $netPrice, float $price, float $taxValue, float $taxRate) | ||
{ | ||
$this->netPrice = $netPrice; | ||
$this->price = $price; | ||
$this->taxValue = $taxValue; | ||
$this->taxRate = $taxRate; | ||
} | ||
|
||
|
||
public function getNetPrice(): float | ||
{ | ||
return $this->netPrice; | ||
} | ||
|
||
|
||
public function getPrice(): float | ||
{ | ||
return $this->price; | ||
} | ||
|
||
|
||
public function getTaxValue(): float | ||
{ | ||
return $this->taxValue; | ||
} | ||
|
||
|
||
public function getTaxRate(): float | ||
{ | ||
return $this->taxRate; | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.