1 | <?php |
||
20 | class Price |
||
21 | { |
||
22 | protected $netAmount = 0; |
||
23 | protected $grossAmount = 0; |
||
24 | protected $taxAmount = 0; |
||
25 | protected $taxRate = 0; |
||
26 | protected $currency = ''; |
||
27 | |||
28 | public function getNetAmount(): float |
||
32 | |||
33 | public function setNetAmount(float $netAmount) |
||
37 | |||
38 | public function getGrossAmount(): float |
||
42 | |||
43 | public function setGrossAmount(float $grossAmount) |
||
47 | |||
48 | public function getTaxAmount(): float |
||
52 | |||
53 | public function setTaxAmount(float $taxAmount) |
||
57 | |||
58 | public function getTaxRate(): float |
||
62 | |||
63 | public function setTaxRate(float $taxRate) |
||
67 | |||
68 | public function getCurrency(): string |
||
72 | |||
73 | public function setCurrency(string $currency) |
||
77 | } |
||
78 |
This check looks for assignments to scalar types that may be of the wrong type.
To ensure the code behaves as expected, it may be a good idea to add an explicit type cast.