1 | <?php declare(strict_types=1); |
||
16 | trait CartPrices |
||
17 | { |
||
18 | public function totalNet(): Money |
||
22 | |||
23 | public function totalGross(): Money |
||
27 | |||
28 | public function tax(): Money |
||
32 | |||
33 | public function totalAfterDiscounts(): Money |
||
37 | |||
38 | public function shippingCost(): Money |
||
42 | |||
43 | public function paymentFee(): Money |
||
47 | } |
||
48 |
In PHP it is possible to write to properties without declaring them. For example, the following is perfectly valid PHP code:
Generally, it is a good practice to explictly declare properties to avoid accidental typos and provide IDE auto-completion: