| Total Complexity | 5 |
| Total Lines | 51 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 14 | class MessageAudio extends MessageContent |
||
| 15 | { |
||
| 16 | public const TYPE_NAME = 'messageAudio'; |
||
| 17 | |||
| 18 | /** |
||
| 19 | * The audio description. |
||
| 20 | * |
||
| 21 | * @var Audio |
||
| 22 | */ |
||
| 23 | protected Audio $audio; |
||
| 24 | |||
| 25 | /** |
||
| 26 | * Audio caption. |
||
| 27 | * |
||
| 28 | * @var FormattedText |
||
| 29 | */ |
||
| 30 | protected FormattedText $caption; |
||
| 31 | |||
| 32 | public function __construct(Audio $audio, FormattedText $caption) |
||
| 33 | { |
||
| 34 | parent::__construct(); |
||
| 35 | |||
| 36 | $this->audio = $audio; |
||
| 37 | $this->caption = $caption; |
||
| 38 | } |
||
| 39 | |||
| 40 | public static function fromArray(array $array): MessageAudio |
||
| 45 | ); |
||
| 46 | } |
||
| 47 | |||
| 48 | public function typeSerialize(): array |
||
| 49 | { |
||
| 50 | return [ |
||
| 51 | '@type' => static::TYPE_NAME, |
||
| 52 | 'audio' => $this->audio->typeSerialize(), |
||
| 53 | 'caption' => $this->caption->typeSerialize(), |
||
| 54 | ]; |
||
| 55 | } |
||
| 56 | |||
| 57 | public function getAudio(): Audio |
||
| 58 | { |
||
| 59 | return $this->audio; |
||
| 60 | } |
||
| 61 | |||
| 62 | public function getCaption(): FormattedText |
||
| 65 | } |
||
| 66 | } |
||
| 67 |