| 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() |
||
| 28 | |||
| 29 | /** |
||
| 30 | * @return \ShippoClient\Entity\TrackingHistory |
||
| 31 | */ |
||
| 32 | public function getTrackingHistory() |
||
| 39 | |||
| 40 | public function toArray() |
||
| 49 | } |
||
| 50 |
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: