Skip to content

Commit 9c2cd96

Browse files
authored
Update WhatsAppAudio.php (#514)
Avoiding Error Typed property Vonage\Messages\Channel\WhatsApp\WhatsAppAudio::$context must not be accessed before initialization
1 parent 4cc6ae6 commit 9c2cd96

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

src/Messages/Channel/WhatsApp/WhatsAppAudio.php

+1-4
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,7 @@ public function toArray(): array
2626
{
2727
$returnArray = $this->getBaseMessageUniversalOutputArray();
2828
$returnArray['audio'] = $this->audioObject->toArray();
29-
30-
if (!is_null($this->context)) {
31-
$returnArray['context'] = $this->context;
32-
}
29+
$returnArray['context'] = $this->context ?? null;
3330

3431
return $returnArray;
3532
}

0 commit comments

Comments
 (0)