| 1 | <?php | ||
| 5 | trait ShowTrait | ||
| 6 | { | ||
| 7 | |||
| 8 | /** | ||
| 9 | * Get show ID | ||
| 10 | * @return int | ||
| 11 | */ | ||
| 12 | 2 | public function getId() | |
| 16 | |||
| 17 | /** | ||
| 18 | * Get show overview | ||
| 19 | * @return string | ||
| 20 | */ | ||
| 21 | 2 | public function getOverview() | |
| 25 | |||
| 26 | /** | ||
| 27 | * Get show first air date | ||
| 28 | * @return string | ||
| 29 | */ | ||
| 30 | 2 | public function getReleaseDate() | |
| 34 | |||
| 35 | /** | ||
| 36 | * Get show original name | ||
| 37 | * @return string | ||
| 38 | */ | ||
| 39 | 2 | public function getOriginalTitle() | |
| 43 | |||
| 44 | /** | ||
| 45 | * Get show name | ||
| 46 | * @return string | ||
| 47 | */ | ||
| 48 | 2 | public function getTitle() | |
| 52 | |||
| 53 | } | ||
| 54 | 
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: