| 1 | <?php |
||
| 5 | abstract class Element |
||
| 6 | { |
||
| 7 | /** |
||
| 8 | * Get item poster |
||
| 9 | * @param string $size |
||
| 10 | * @return string |
||
| 11 | */ |
||
| 12 | 21 | public function getPoster(string $size = 'w185'): string |
|
| 16 | |||
| 17 | /** |
||
| 18 | * Get item backdrop |
||
| 19 | * @param string $size |
||
| 20 | * @return string|null |
||
| 21 | */ |
||
| 22 | 21 | public function getBackdrop(string $size = 'w780'): string |
|
| 26 | |||
| 27 | /** |
||
| 28 | * Get poster path |
||
| 29 | */ |
||
| 30 | public function getPosterPath(): string |
||
| 38 | |||
| 39 | /** |
||
| 40 | * Get backdrop |
||
| 41 | */ |
||
| 42 | public function getBackdropPath(): string |
||
| 50 | |||
| 51 | /** |
||
| 52 | * Get image url from type and size |
||
| 53 | * @param string $type |
||
| 54 | * @param string $size |
||
| 55 | * @return string |
||
| 56 | * @throws \Exception |
||
| 57 | */ |
||
| 58 | 42 | private function getImage(string $type, string $size): string |
|
| 76 | |||
| 77 | } |
||
| 78 |
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: