1 | <?php |
||
7 | class Tracks |
||
8 | { |
||
9 | use ReadableAttributes { |
||
10 | mayHaveAsString as public getCarrier; |
||
11 | mayHaveAsString as public getTrackingNumber; |
||
12 | toArray as public __toArray; |
||
13 | } |
||
14 | |||
15 | /** |
||
16 | * @return \ShippoClient\Entity\TrackingStatus |
||
17 | */ |
||
18 | public function getTrackingStatus() |
||
23 | |||
24 | /** |
||
25 | * @return \ShippoClient\Entity\TrackingHistory |
||
26 | */ |
||
27 | public function getTrackingHistory() |
||
34 | |||
35 | /** |
||
36 | * @return \DateTime |
||
37 | */ |
||
38 | public function getEta() |
||
42 | |||
43 | /** |
||
44 | * @return \ShippoClient\Entity\Location |
||
45 | */ |
||
46 | public function getAddressFrom() |
||
50 | |||
51 | /** |
||
52 | * @return \ShippoClient\Entity\Location |
||
53 | */ |
||
54 | public function getAddressTo() |
||
58 | |||
59 | /** |
||
60 | * @return \ShippoClient\Entity\ServiceLevel |
||
61 | */ |
||
62 | public function getServiceLevel() |
||
66 | |||
67 | public function toArray() |
||
80 | } |
||
81 |
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: