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() |
||
43 | |||
44 | /** |
||
45 | * @return \ShippoClient\Entity\Location |
||
46 | */ |
||
47 | public function getAddressTo() |
||
51 | |||
52 | /** |
||
53 | * @return \ShippoClient\Entity\ServiceLevel |
||
54 | */ |
||
55 | public function getServiceLevel() |
||
59 | |||
60 | public function toArray() |
||
73 | } |
||
74 |
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: