1 | <?php |
||
7 | class Tracks |
||
8 | { |
||
9 | use ReadableAttributes { |
||
10 | mayHaveAsString as public getCarrier; |
||
11 | mayHaveAsString as public getTrackingNumber; |
||
12 | mayHaveAsString as public getEta; |
||
13 | toArray as public __toArray; |
||
14 | } |
||
15 | |||
16 | /** |
||
17 | * @return \ShippoClient\Entity\TrackingStatus |
||
18 | */ |
||
19 | public function getTrackingStatus() |
||
24 | |||
25 | /** |
||
26 | * @return \ShippoClient\Entity\TrackingHistory |
||
27 | */ |
||
28 | public function getTrackingHistory() |
||
35 | |||
36 | /** |
||
37 | * @return \ShippoClient\Entity\Location |
||
38 | */ |
||
39 | public function getAddressFrom() |
||
45 | |||
46 | /** |
||
47 | * @return \ShippoClient\Entity\Location |
||
48 | */ |
||
49 | public function getAddressTo() |
||
55 | |||
56 | /** |
||
57 | * @return \ShippoClient\Entity\ServiceLevel |
||
58 | */ |
||
59 | public function getServiceLevel() |
||
63 | |||
64 | public function toArray() |
||
77 | } |
||
78 |
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: