src/Model/Song.php
public static function fromApi(array $data): self
    {
        $artist = isset($data['artist']) ? Artist::fromApi($data['artist']) : null;

        return new self(
            $data['name'],
            isset($data['duration']) ? (int) $data['duration'] : null,
            $artist
        );
    }
public static function fromApi(array $data): self
    {
        $artist = isset($data['artist']) ? Artist::fromApi($data['artist']) : null;

        return new self(
            $data['name'],
            isset($data['duration']) ? (int) $data['duration'] : null,
            $artist
        );
    }
@param array $data

@return Song