| 1 | <?php |
||
| 14 | final class Song |
||
| 15 | { |
||
| 16 | /** |
||
| 17 | * @var string |
||
| 18 | */ |
||
| 19 | private $name; |
||
| 20 | |||
| 21 | /** |
||
| 22 | * @var int|null |
||
| 23 | */ |
||
| 24 | private $duration; |
||
| 25 | |||
| 26 | /** |
||
| 27 | * @var Artist|null |
||
| 28 | */ |
||
| 29 | private $artist; |
||
| 30 | |||
| 31 | public function __construct(string $name, ?int $duration, ?Artist $artist) |
||
| 37 | |||
| 38 | public function getName(): string |
||
| 42 | |||
| 43 | public function getDuration(): ?int |
||
| 47 | |||
| 48 | public function getArtist(): ?Artist |
||
| 52 | |||
| 53 | /** |
||
| 54 | * @return Song |
||
| 55 | */ |
||
| 56 | public static function fromApi(array $data): self |
||
| 66 | } |
||
| 67 |