| 1 | <?php |
||
| 7 | class StandaloneTrack |
||
| 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 | public function toArray() |
||
| 44 | } |
||
| 45 |
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: