| 1 | <?php |
||
| 6 | class MovieTranslationDTO |
||
| 7 | { |
||
| 8 | private $locale, $title, $overview, $posterUrl; |
||
|
|
|||
| 9 | |||
| 10 | 2 | public function __construct(string $locale, string $title, ?string $overview, ?string $posterUrl) |
|
| 17 | |||
| 18 | /** |
||
| 19 | * @return string |
||
| 20 | */ |
||
| 21 | 2 | public function getLocale(): string |
|
| 25 | |||
| 26 | /** |
||
| 27 | * @return string |
||
| 28 | */ |
||
| 29 | 2 | public function getTitle(): string |
|
| 33 | |||
| 34 | /** |
||
| 35 | * @return null|string |
||
| 36 | */ |
||
| 37 | 2 | public function getOverview(): ?string |
|
| 41 | |||
| 42 | /** |
||
| 43 | * @return null|string |
||
| 44 | */ |
||
| 45 | 2 | public function getPosterUrl(): ?string |
|
| 49 | } |
Only declaring a single property per statement allows you to later on add doc comments more easily.
It is also recommended by PSR2, so it is a common style that many people expect.