1 | <?php |
||
12 | class WebhookTracks |
||
13 | { |
||
14 | use ReadableAttributes { |
||
15 | // tracks object properties |
||
16 | mayHaveAsString as public getCarrier; |
||
17 | mayHaveAsString as public getEta; |
||
18 | // transaction object properties |
||
19 | mayHaveAsString as public getObjectState; |
||
20 | mayHaveAsString as public getObjectStatus; |
||
21 | mayHaveAsString as public getObjectId; |
||
22 | mayHaveAsString as public getObjectOwner; |
||
23 | mayHaveAsString as public getLabelUrl; |
||
24 | mayHaveAsString as public getTrackingUrlProvider; |
||
25 | mayHaveAsString as public getCommercialInvoiceUrl; |
||
26 | mayHaveAsString as public getCustomsNote; |
||
27 | mayHaveAsString as public getSubmissionNote; |
||
28 | mayHaveAsString as public getMetadata; |
||
29 | mayHaveAsArray as public getMessages; |
||
30 | // common properties |
||
31 | mayHaveAsString as public getTrackingNumber; |
||
32 | toArray as public __toArray; |
||
33 | } |
||
34 | |||
35 | /** |
||
36 | * transaction object property |
||
37 | * |
||
38 | * @return \DateTime |
||
39 | */ |
||
40 | public function getObjectCreated() |
||
44 | |||
45 | /** |
||
46 | * transaction object property |
||
47 | * |
||
48 | * @return \DateTime |
||
49 | */ |
||
50 | public function getObjectUpdated() |
||
54 | |||
55 | /** |
||
56 | * tracks object property |
||
57 | * |
||
58 | * @return \ShippoClient\Entity\Location |
||
59 | */ |
||
60 | public function getAddressFrom() |
||
66 | |||
67 | /** |
||
68 | * tracks object property |
||
69 | * |
||
70 | * @return \ShippoClient\Entity\Location |
||
71 | */ |
||
72 | public function getAddressTo() |
||
78 | |||
79 | /** |
||
80 | * tracks object property |
||
81 | * |
||
82 | * @return \ShippoClient\Entity\ServiceLevel |
||
83 | */ |
||
84 | public function getServiceLevel() |
||
90 | |||
91 | /** |
||
92 | * common property |
||
93 | * |
||
94 | * @return \ShippoClient\Entity\TrackingStatus |
||
95 | */ |
||
96 | public function getTrackingStatus() |
||
100 | |||
101 | /** |
||
102 | * common property |
||
103 | * |
||
104 | * @return \ShippoClient\Entity\TrackingHistory |
||
105 | */ |
||
106 | public function getTrackingHistory() |
||
113 | |||
114 | public function toArray() |
||
142 | } |
||
143 |
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: